Commit Graph

852 Commits

Author SHA1 Message Date
Mike Poindexter 9a5d608c21 Switch field storage to an array vs map 2020-03-25 10:24:02 -07:00
tidwall cd70a3d2af Update to Go 1.14 2020-03-22 13:14:08 -07:00
tidwall ff48054d3d Fixed a missing faraway event for roaming geofences
This commit fixes a case where a roaming geofence will not fire
a "faraway" event when it's supposed to.

The fix required rewriting the nearby/faraway detection logic. It
is now much more accurate and takes overall less memory, but it's
also a little slower per operation because each object proximity
is checked twice per update. Once to compare the old object's
surrounding, and once to evaulated the new object. The two lists
are then used to generate accurate "nearby" and "faraway" results.
2020-03-22 11:54:56 -07:00
tidwall b482206894 Minimize sorting of collection fields 2020-03-22 07:58:03 -07:00
Josh Baker 0997f2e82b
Merge pull request #534 from rshura/optimize-scanwriter
Avoid sorting fields for each written object.
2020-03-22 06:33:33 -07:00
Josh Baker 77d33df542
Merge pull request #541 from tidwall/missing-key-field
Fixed DEL geofence notifications missing "key" field
2020-03-21 18:22:54 -07:00
tidwall 65943e8f1a Fixed DEL geofence notifications missing "key" field
Closed #538
2020-03-21 17:48:31 -07:00
tidwall 957233c298 Fixed issue with some features not working with WITHIN
This bug was fixed in the geojson dependency.

https://github.com/tidwall/geojson/pull/15

Closed #539
2020-03-21 17:38:14 -07:00
tidwall 81e449afef Merge branch 'mpoindexter-fix-race-in-replconf' 2020-03-21 17:30:41 -07:00
Mike Poindexter 84cabd77f9 Fix a concurrent write/read on the server conn map 2020-03-20 16:47:13 -07:00
Alex Roitman 5faccc3b4c Avoid sorting fields for each written object. 2020-03-03 13:39:43 -08:00
tidwall 0490734b74 1.19.5 2020-02-11 11:03:20 -07:00
tidwall c567512600 Fix packages not vendoring on build 2020-02-11 11:02:15 -07:00
tidwall 6ffdf7b0ef Add release helper file 2020-02-10 05:43:10 -07:00
tidwall 55b4c8fd57 1.19.4 2020-02-10 05:26:22 -07:00
tidwall 2f907bd4c0 Update geojson
Fixes #529
2020-02-10 05:18:52 -07:00
tidwall d48dd2278a 1.19.3 2019-12-11 11:19:53 -07:00
tidwall 66af8ab094 Fix tile38-cli from freezing with non-quoted geojson
This commit addresses an issue that began on 1.19 where the
deprecated tile38 native line protocol was removed in favor of
the more robust resp protocol. In turn the tile38 cli required
that all args are quoteless or quote escaped.

The commit ensures that the server returns the correct error
message and also loosens the strictness of the need for quoted
arguments in the tile38-cli.

fixes #513
2019-12-11 11:08:33 -07:00
tidwall c047c44ac6 Update changelog 2019-11-28 10:46:48 -07:00
tidwall 0db642f743 1.19.2 2019-11-28 10:37:33 -07:00
tidwall 6f3716a0cf Fixes a false negative for intersecting rings
https://github.com/tidwall/geojson/commit/ac08098
2019-11-28 10:13:00 -07:00
tidwall 644f65c7d9 1.19.1 2019-11-18 15:21:54 -07:00
tidwall 953f2f20ee Ensure build passes on test 2019-11-18 11:04:31 -07:00
tidwall 9d8eb05258 Update travis ci test and push 2019-11-18 10:56:41 -07:00
tidwall cfc65a13f6 Refactor repository and build scripts
This commit includes updates that affects the build, testing, and
deployment of Tile38.

- The root level build.sh has been broken up into multiple scripts
  and placed in the "scripts" directory.

- The vendor directory has been updated to follow the Go modules
  rules, thus `make` should work on isolated environments. Also
  some vendored packages may have been updated to a later
  version, if needed.

- The Makefile has been updated to allow for making single
  binaries such as `make tile38-server`. There is some scaffolding
  during the build process, so from now on all binaries should be
  made using make. For example, to run a development version of
  the tile38-cli binary, do this:
     make tile38-cli && ./tile38-cli
  not this:
     go run cmd/tile38-cli/main.go

- Travis.CI docker push script has been updated to address a
  change to Docker's JSON repo meta output, which in turn fixes
  a bug where new Tile38 versions were not being properly pushed
  to Docker
2019-11-18 10:33:15 -07:00
tidwall 4b17a1b828 Nuke vendor directory 2019-11-17 15:01:07 -07:00
tidwall b27f32a66e Updated to Go modules 2019-11-17 14:38:27 -07:00
tidwall 69b146effd Add tile38-benchmark to Dockerfile
closes #470
2019-11-17 13:13:44 -07:00
tidwall 2c863cc4e7 Fixed image urls 2019-11-17 09:02:13 -07:00
tidwall fa4a1dd436 Added .github directory 2019-11-17 09:00:45 -07:00
Josh Baker d4fc7358ac Update issue templates 2019-11-17 08:57:44 -07:00
Josh Baker cc89e10c2e
Merge pull request #509 from tidwall/aofshrink-panic-508
Fixed panic on AOFSHRINK
2019-11-17 07:37:41 -07:00
tidwall 474ff810c0 Fixed panic on AOFSHRINK
closes #508
2019-11-17 07:25:25 -07:00
Josh Baker 0d0de39ff1
Updated slack link 2019-11-05 09:43:57 -07:00
tidwall 9d2753378e Fix infinite loop on connection failure 2019-11-03 13:29:33 -07:00
tidwall 813772f2c6 1.19.0 2019-11-02 15:36:08 -07:00
Josh Baker c7b4712c4e
Merge pull request #505 from tidwall/travis-go-1.13
Update travis-ci to Go 1.13
2019-11-02 15:34:04 -07:00
tidwall d675758e58 Update travis-ci to Go 1.13 2019-11-02 15:28:47 -07:00
tidwall c084aeedc2 Code cleanup
This commit cleans up various Go code in the internal directory.
- Ensures comments on exported functions
- Changes all *Server receiver in all files to be "s", instead
  of mixed "c", "s", "server", etc.
- Silenced Go warnings for if/else with returns.
- Cleaned up import ordering.
2019-10-30 10:17:59 -07:00
Josh Baker 981d9ece42
Merge pull request #503 from JordanArmstrong/fix-stats-cpu
Fix fprintf type error in stats_cpu.go for non-linux/darwin builds
2019-10-29 15:29:38 -07:00
Josh Baker 90c2474e3d
Merge pull request #501 from JordanArmstrong/strict-jset-numbers
Strictly check if values passed to JSET are numbers
2019-10-29 15:28:40 -07:00
tidwall 23b016d192 Fix excessive memory usage for objects with TTLs
This commit fixes an issue where Tile38 was using lots of extra
memory to track objects that are marked to expire. This was
creating problems with applications that set big TTLs.

How it worked before:

Every collection had a unique hashmap that stores expiration
timestamps for every object in that collection. Along with
the hashmaps, there's also one big server-wide list that gets
appended every time a new SET+EX is performed.

From a background routine, this list is looped over at least
10 times per second and is randomly searched for potential
candidates that might need expiring. The routine then removes
those entries from the list and tests if the objects matching
the entries have actually expired. If so, these objects are
deleted them from the database. When at least 25% of
the 20 candidates are deleted the loop is immediately
continued, otherwise the loop backs off with a 100ms pause.

Why this was a problem.

The list grows one entry for every SET+EX. When TTLs are long,
like 24-hours or more, it would take at least that much time
before the entry is removed. So for databased that have objects
that use TTLs and are updated often this could lead to a very
large list.

How it was fixed.

The list was removed and the hashmap is now search randomly. This
required a new hashmap implementation, as the built-in Go map
does not provide an operation for randomly geting entries. The
chosen implementation is a robinhood-hash because it provides
open-addressing, which makes for simple random bucket selections.

Issue #502
2019-10-29 11:19:33 -07:00
Jordan Armstrong 324b3b06d9 Fix go vet error in stats_cpu.go for non-linux/darwin builds 2019-10-28 22:39:27 -03:00
Jordan Armstrong e0eca0d55e Replace isJsonNumber with version from gjson 2019-10-28 22:35:44 -03:00
Josh Baker df477bf3f4
Merge pull request #464 from rshura/area-expression
Add area expressions.
2019-10-28 13:45:10 -07:00
tidwall f9ea3f1e13 Fixed tile38-cli not propertly handling quotes
closes #500
2019-10-28 13:25:08 -07:00
tidwall 10f7bfc445 Fix invalid pubsub format for json output
This commit fixes a bug that causes bad formatting for geofence
notifications when a client's output is set to JSON.

closes #499
2019-10-28 12:51:44 -07:00
Jordan Armstrong 41fb410e2e Strictly check if values to JSET are numbers
Fixes #493
2019-10-26 23:37:48 -03:00
tidwall d2cfb87c89 1.18.0 2019-10-09 11:57:43 -07:00
tidwall b092cea0d2 Use WaitTimeout for MQTT 2019-10-08 11:13:18 -07:00