353 Commits

Author SHA1 Message Date
tidwall
1477026721 Updated Kafka version 2021-07-08 06:34:15 -07:00
Lars Wilhelmsen
47ac560f83 Fix crash in fenceMatchRoam causing an index out of range panic 2021-07-08 06:33:38 -07:00
tidwall
97c1ec5c5d Fix OUTPUT client command requiring authentication
This commit fixes an issue where the OUTPUT command requires
authentication when a server password has been set with
CONFIG SET requirepass. This was causing problems with clients
that use json responses, like the tile38-cli.

Fixes #564
2021-07-08 06:33:38 -07:00
Jan Pacák
71fa16a19e amqp: removal of queue and binding creation 2021-05-13 00:44:27 +02:00
tidwall
b467c6f1cb Change 255 to 256 2021-04-28 05:10:18 -07:00
tidwall
47a4e16c0b Add comment 2021-04-28 05:09:48 -07:00
tidwall
d37ce505f5 Allow for all command types for roaming event
Prior to this commit roaming geofences only registered changes to
the SET command. Now it will work for SET/DEL/FSET, just like
non-roaming geofences.

To opt out of these events, explicitly choose which event you
would like to register when you create the geofences.

For example:

  NEARBY fleet FENCE COMMANDS set,del ROAM fleet * 5000

Will only fire off events from SET and DEL command.

Closes #597
2021-04-01 14:59:12 -07:00
tidwall
5e440b621b Remove deprecated function
Go recommends not calling BuildNameToCertificate and to allow
for the names to be selected automatically.
2021-03-31 08:15:52 -07:00
tidwall
6b08f7fa9e Code cleanup
- Removed unused functions and variables
- Wrapped client formatted errors
- Updated deprecated packages
- Changed suggested code patterns
2021-03-31 08:13:44 -07:00
tidwall
40105e6b7e Include "distance" to output when user specifically requests
fixes #599
2021-03-30 11:49:01 -07:00
tidwall
0d69799653 Merge branch 'kafka-tls' of https://github.com/iwpnd/tile38 into iwpnd-kafka-tls 2021-02-18 15:34:09 -07:00
tidwall
9ac25647ad Expose log output writer 2021-02-18 15:34:01 -07:00
Benjamin Ramser
d7c0c5b855 refactor: dont set client id 2021-02-18 22:35:49 +01:00
Benjamin Ramser
734d33365a add kafka tls config
fix endpoint, add logging to tlsconfig creation

add logging if log.Level > 2
2021-02-17 14:35:42 +01:00
tidwall
72dfaaec63 Updated dependencies 2021-02-07 17:54:56 -07:00
tidwall
3ed048242e Various updates
- Updated all dependencies
- Updated geoindex Box api
2021-02-03 14:30:55 -07:00
tidwall
016f397124 Replace tinybtree 2021-01-25 14:34:40 -07:00
tidwall
9ce20331e4 Fixed fields being shuffled after AOFSHRINK 2020-11-09 14:45:40 -07:00
tidwall
1a7d8d6431 Added ENV var for 500 http errors 2020-11-07 05:22:11 -07:00
tidwall
79bee8523b Updated btree deps 2020-10-27 15:29:50 -07:00
tidwall
9998e03f6f Optimization for non-cross geofence detection
This commit fixes a performance issue with the algorithm that
determines with geofences are potential candidates for
notifications following a SET operation.

Details

Prior to commit b471873 (10 commits ago) there was a bug where
the "cross" detection was not firing in all cases. This happened
because when looking for candidates for "cross" due to a SET
operation, only the geofences that overlapped the previous
position of the object and the geofences that overlapped the new
position where searched. But, in fac, all of the geofences that
overlapped the union rectangle of the old and new position should
have been searched.

That commit fixed the problem by searching a union rect of the
old and new positions. While this is an accurate solution, it
caused a slowdown on systems that have big/wild position changes
that might cross a huge number of geofences, even when those
geofences did not need actually need "cross" detection.

The fix

With this commit the geofences that have a "cross" detection
are stored in a seperated tree from those that do not. This
allows for a hybrid of the functionality prior and post b471873.

Fixes #583
2020-10-23 09:51:27 -07:00
tidwall
93e3a067b7 Truncate trailing zeros from AOF at startup
This commit addresses issue #230, where an AOF file will sometimes
not load due to the file being padded with trailing zeros. It's
uncertain what is causing this corruption, but it appears to be
coming from outside of the tile38-server process. I suspect it's
due to some block store layer in Kubernetes/Docker cloud
environments.

This fix allows for Tile38 to start up by discovering the trailing
zeros while loading the AOF and safely truncating the file as to
not include the zeros in the future.
2020-10-07 09:52:32 -07:00
tidwall
b47187349b Fix "cross" detection on firing in some cases
Fixes #578
2020-09-22 16:19:49 -07:00
tidwall
d819db5f8b Added MONITOR command
closes #571
2020-08-12 12:38:52 -07:00
tidwall
9093926135 Limit geohash precision to 12 2020-08-12 10:58:49 -07:00
Terra Brown
9202fd0206
s/64/12/ 2020-08-11 18:11:06 -04:00
tidwall
f23b46cfc0 Hotfix for previous commit 2020-07-04 10:35:07 -07:00
tidwall
f3622c3756 Fixed wrong order for fields with SCAN
This commit fixes an issue that happens when running SCAN on a
collection that has objects with fields, causing field values
to be mismatched with their respective keys.

This only occured with json output, and is a regression from #534.

Fixes #569
2020-07-04 10:12:06 -07:00
tidwall
68e2b6d736 Updated Kafka version 2020-07-03 11:57:15 -07:00
Lars Wilhelmsen
4fdbade7a4
Fix crash in fenceMatchRoam causing an index out of range panic 2020-06-18 15:43:18 +02:00
tidwall
b7978f2cf4 Fix OUTPUT client command requiring authentication
This commit fixes an issue where the OUTPUT command requires
authentication when a server password has been set with
CONFIG SET requirepass. This was causing problems with clients
that use json responses, like the tile38-cli.

Fixes #564
2020-06-04 12:57:23 -07:00
Mads Schou-Andreasen
cf757802a3 fixed default credentials 2020-05-30 10:26:25 +02:00
Mads Schou-Andreasen
bff11ad0ae minor documentation fix 2020-05-19 17:24:06 +02:00
Mads Schou-Andreasen
37224791f4 added geofence webhook for GCP Pubsub 2020-05-19 17:11:31 +02:00
tidwall
3718cd766b Added priority option for AMQP endpoints 2020-05-16 14:31:52 -07:00
tidwall
70cd167fc0 Fixed clip test #558 2020-05-03 09:59:49 -07:00
Alex Roitman
25579a052c Fix a bug in WHEREIN -- 0 values would always match, incorrectly. 2020-04-12 16:06:10 -07:00
Alex Roitman
914f51de11 Fixes 2020-04-09 09:59:24 -07:00
Alex Roitman
fe0216c42c Restore previous behavior where non-existing fields are treated as zero-value. 2020-04-09 09:54:47 -07:00
Alex Roitman
f3cc365d24 Pre-allocate where and wherein arrays. 2020-04-09 09:36:12 -07:00
Mike Poindexter
042582aef3 Update comment 2020-04-08 11:38:12 -07:00
Mike Poindexter
2a4272c95f Improve kNN behavior
The current KNN implementation has two areas that can be improved:

- The current behavior is somewhat incorrect. When performing a kNN
query, the current code fetches k items from the index, and then sorts
these items according to Haversine distance. The problem with this
approach is that since the items fetched from the index are ordered by
a Euclidean metric, there is no guarantee that item k + 1 is not closer
than item k in great circle distance, and hence incorrect results can be
returned when closer items beyond k exist.

- The secondary sort is a performance killer. This requires buffering
all k items (again...they were already run through a priority queue in)
the index, and then a sort. Since the items are mostly sorted, and
Go's sort implementation is a quickSort this is the worst case for the
sort algorithm.

Both of these can be fixed by applying a proper distance metric in
the index nearby operation. In addition, this cleans up the code
considerably, removing a number of special cases that applied only
to NEARBY operations.

This change implements a geodetic distance metric that ensures that
the order from the index is correct, eliminating the need for the
secondary sort and special filtering cases in the ScanWriter code.
2020-04-07 20:10:58 -07:00
Alex Roitman
34cb2affdc Add clipby subcommand to INTERSECTS/WITHIN 2020-04-03 16:49:06 -07:00
Josh Baker
f02dee3db2
Merge pull request #545 from tidwall/index-kind-geometry-nooverride
Match geometry indexing to server config
2020-04-02 08:15:38 -07:00
Josh Baker
12a98c53e4
Merge pull request #543 from rshura/fix-clip-empty-rings
Skip empty rings when clipping polygons.
2020-04-02 08:15:14 -07:00
tidwall
951fc58e02 Match geometry indexing to server config 2020-03-25 15:35:31 -07:00
Alex Roitman
d5132a9eae Map field names to array indices in scanwriter, once per query. 2020-03-25 15:15:06 -07:00
Alex Roitman
9e7766b346 Array of values instead of map for whereins. 2020-03-25 15:14:51 -07:00
Alex Roitman
27c6980f82 Copy array and only loop if we need to pad. 2020-03-25 15:14:37 -07:00
Alex Roitman
91ef777771 Add benchmark for fieldMatch. 2020-03-25 14:49:21 -07:00