Commit Graph

28 Commits

Author SHA1 Message Date
tidwall 9c471e3f9c Replace out old style atomics 2022-11-03 10:07:17 -07:00
tidwall ad8d40dee5 Better AOF/AOFMD5 tests 2022-09-26 15:43:14 -07:00
tidwall f2c3b3924a wip - aof tests 2022-09-25 03:54:22 -07:00
tidwall 2c643996e7 Immutable Object type 2022-09-20 14:20:53 -07:00
tidwall d5c148ca41 Field overhaul 2022-09-19 17:47:38 -07:00
tidwall 67916f38f8 Reset wheres while geofencing 2022-08-30 16:50:19 -07:00
tidwall a1cc8e6e46 Fix eof error for incomplete commands.
This commit fixes an issue where Tile38 will fail to start
because the AOF file contains a partially written command, which
is caused by the server not having enough disk space to complete
the previous write.

This was discovered and reported by a Theresa D on the Tile38
Slack channel.
2022-04-12 15:43:55 -07:00
tidwall 8829b8ffc3 Change hooks collection type from hashmap to btree
This commit changes the collection type that holds all of the
hooks from a hashmap to a btree. This allows for better
flexibility for operations that need to perform range searches
and scanning of the collection.
2021-09-13 10:02:36 -07:00
tidwall df8d3d7b12 Close follower files before finishing aofshrink
fixes #449
2021-06-13 07:53:27 -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 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 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
tidwall 639f6e2deb Replaced boxtree for rbang 2019-09-12 18:42:53 -07:00
tidwall 2571ce5106 Minimize AOF buffer releases 2019-09-03 17:01:26 -07:00
tidwall 5333fab870 Recycle aof buffer 2019-03-10 10:48:14 -07:00
Steven Wolfe eb2ff76f86 Sorting > 1 and docs 2019-01-09 10:35:50 -07:00
Steven Wolfe a5fbcf5f15 Ensuring channel publish order 2019-01-09 00:23:53 -07:00
tidwall 6b2fc1f37f Fix multiple matches on different key hooks 2018-11-29 15:15:26 -08:00
tidwall 8b29e98359 Optimized spatial index for fences 2018-11-23 18:15:14 -07:00
tidwall f2c217c216 Refactor and comment command details 2018-11-23 15:53:33 -07:00
tidwall 1197cca40c Avoid extra broadcasts 2018-11-23 15:38:49 -07:00
tidwall 37531f9350 Removed unused atomics 2018-11-23 01:39:04 -07:00
tidwall 58421ef806 Removed unused code 2018-11-23 01:24:35 -07:00
tidwall a0f3b0049f Fix aof loading problem 2018-11-15 09:15:39 -07:00
tidwall 12b47b39ce Prewrite optimization flag 2018-11-10 16:16:04 -07:00
tidwall 555e47036c Replaced net package with evio
- Added threads startup flag
- Replaced net package with evio
- Refactored controller into server
2018-10-28 15:51:47 -07:00