382 Commits

Author SHA1 Message Date
tidwall
5a37198602 Added HEALTHZ command
Returns 'ok' if the server is the leader or a follower with
a 'caught up' log.

This is mainly for HTTP connections that are using an
orchestration environment like kubernetes, but will work as a
general RESP command.

For HTTP a '200 OK' for 'caught up' and
'500 Internal Server Error' otherwise.

See #608
2021-07-08 06:46:57 -07:00
Oliver
fc0ff42297 add more metrics, add metrics index page 2021-07-08 06:46:57 -07:00
Oliver
f448599e72 cleanup / fix tests 2021-07-08 06:46:57 -07:00
Oliver
a233aaa66e don't rely on stats code for new metrics if we can avoid it 2021-07-08 06:46:57 -07:00
tidwall
5b3aeb5db7 add prometheus metrics endpoint 2021-07-08 06:46:52 -07:00
tidwall
0b8254e7c2 Change 255 to 256 2021-07-08 06:46:13 -07:00
tidwall
5cf6c4e9f4 Add comment 2021-07-08 06:46:13 -07:00
tidwall
b5691f7dd5 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-07-08 06:46:13 -07:00
tidwall
6bb9f8f54c Remove deprecated function
Go recommends not calling BuildNameToCertificate and to allow
for the names to be selected automatically.
2021-07-08 06:46:12 -07:00
tidwall
58221adccb Code cleanup
- Removed unused functions and variables
- Wrapped client formatted errors
- Updated deprecated packages
- Changed suggested code patterns
2021-07-08 06:46:08 -07:00
tidwall
6a55c8de8f fix: distance if point and object have the same coordinates 2021-07-08 06:45:31 -07:00
tidwall
901919c4e3 Include "distance" to output when user specifically requests
fixes #599
2021-07-08 06:36:45 -07:00
Benjamin Ramser
8234f6dc6d refactor: dont set client id 2021-07-08 06:36:10 -07:00
tidwall
b64c87004f Expose log output writer 2021-07-08 06:36:10 -07:00
Benjamin Ramser
248c3d8b72 add kafka tls config
fix endpoint, add logging to tlsconfig creation

add logging if log.Level > 2
2021-07-08 06:36:10 -07:00
tidwall
60678020fa Updated dependencies 2021-07-08 06:36:10 -07:00
tidwall
094d35757c Various updates
- Updated all dependencies
- Updated geoindex Box api
2021-07-08 06:36:05 -07:00
tidwall
f44bae43ca Replace tinybtree 2021-07-08 06:35:15 -07:00
tidwall
67f443dbbd Fixed fields being shuffled after AOFSHRINK 2021-07-08 06:35:06 -07:00
tidwall
07dc10262a Added ENV var for 500 http errors 2021-07-08 06:35:06 -07:00
tidwall
076cd4b009 Updated btree deps 2021-07-08 06:35:01 -07:00
tidwall
9d9c2b9aeb 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
2021-07-08 06:34:47 -07:00
tidwall
2eb6da5f21 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.
2021-07-08 06:34:47 -07:00
tidwall
6aab7ee309 Fix "cross" detection on firing in some cases
Fixes #578
2021-07-08 06:34:15 -07:00
tidwall
3d7242d06c Added MONITOR command
closes #571
2021-07-08 06:34:15 -07:00
tidwall
5f5c4d9f03 Limit geohash precision to 12 2021-07-08 06:34:15 -07:00
Terra Brown
019995e5f6 s/64/12/ 2021-07-08 06:34:15 -07:00
tidwall
b606f23bd0 Hotfix for previous commit 2021-07-08 06:34:15 -07:00
tidwall
67abcefd25 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
2021-07-08 06:34:15 -07:00
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