Commit Graph

53 Commits

Author SHA1 Message Date
tidwall 3011b6ec45 Upgrade geojson dependency 2022-09-14 08:14:29 -07:00
tidwall 1177bbb80c Moved root collection keys into generic btree.
Also updated the background expires logic to remove an extra
allocation.
2022-09-13 08:16:41 -07:00
tidwall dd11eded5c Cleanup code for Go 1.19 2022-09-12 17:06:27 -07:00
tidwall cbfb271541 Updated data structures to use Go generics.
Prior to this commit all objects in the Collection data structures
were boxed in an Go interface{} which adds an extra 8 bytes per
object and requires assertion to unbox.

Go 1.18, released early 2022, introduced generics, which allows
for storing the objects without boxing. This provides a extra
boost in performance and lower in-memory footprint.
2022-09-12 09:12:51 -07:00
tidwall 498bbe23ff Updated btree and rtree
This commit updates to the latest btree and rtree.

The rtree algorithm has been modified in `tidwall/rtree@v1.7`
which now keeps internal and leaf rect sorted by the min-x
coordinate. This make for much faster (up to 50%) faster
searches and replacements, but slightly slower inserts.

Because of the R-tree update, the tests needed to be updated to
account for the change in order for undeterministic WITHIN and
INTERSECTS commands.
2022-09-11 14:31:00 -07:00
Benjamin Ramser 09ca96717b fix: allow host ca sets for SASL and TLS connections
?ssl=true previously would require the user to provide a cacertfile
stripping the option to use the hosts ca set.

bumping sarama to version 1.36.0
bumping alpine to 3.16.2

fix: tls path
2022-09-07 11:10:10 +02:00
tidwall fcdb469ee4 Security updates
github.com/nats-io/nats-server/v2 (CVE-2022-26652)
golang.org/x (CVE-2021-38561)
2022-03-16 12:13:44 -07:00
tidwall a124738a94 Upgrade to Go 1.18 2022-03-15 14:52:33 -07:00
tidwall 38ea913bb5 Upgrade prometheous client 2022-03-08 16:35:22 -07:00
tidwall 218200525b Upgrade nats dependencies 2022-03-08 16:21:15 -07:00
tidwall 45fde6a430 Upgrate nats package
CVE-2022-24450
2022-02-12 18:04:48 -07:00
tidwall 728c618a8a Updated dependencies 2021-12-28 16:56:01 -07:00
Benjamin Ramser 20cc624918 feat: add option to cmd, add default config
feat: add zap logger

test: add additional

refactor: dont export logger, use set/get/build

fix: getter and benchmark

feat: extend server config with log configuration

fix: log config write

fix: log
2021-12-26 16:06:34 +01:00
tidwall f3947407aa Upgrade gjson and btree 2021-12-08 16:33:10 -07:00
tidwall a47443a48c Upgrade tidwall modules 2021-10-25 15:12:23 -07:00
dependabot[bot] 8dffa06c3a
Bump github.com/tidwall/gjson from 1.8.1 to 1.9.3
Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.8.1 to 1.9.3.
- [Release notes](https://github.com/tidwall/gjson/releases)
- [Commits](https://github.com/tidwall/gjson/compare/v1.8.1...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/tidwall/gjson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 21:57:00 +00:00
tidwall 11cea4d092 Remove vendor directory
In the past we needed to vendor out Go packages because there wasn't
a built-in Go package manager. That changed with Go Modules, which has
been stable for a while now. The Go Modules system will maintain
packages versions, handle the fetching, checksuming, and keep a
public cached of the source code.
2021-10-22 06:22:08 -07:00
Simon Tuohy 4454995e06 Azure EventHub hook support 2021-10-15 15:22:41 +01:00
Benjamin Ramser bc62edb692 feat: add sector 2021-09-05 11:48:34 +02:00
tidwall b7674349cf Updated btree library 2021-08-23 07:33:57 -07:00
tidwall 5c21d1277f Update buntdb 2021-08-04 14:47:09 -07:00
tidwall 17ab07bd3e Update tidwall dependencies 2021-07-31 07:45:09 -07:00
tidwall 694ad1fb62 Update btree/buntdb 2021-07-31 07:42:58 -07:00
tidwall afd77d9448 Update nats-server dependency
Dependabot alert
2021-07-29 17:23:41 -07:00
tidwall 9e68703841 Update expiration logic
This commit changes the logic for managing the expiration of
objects in the database.

Before: There was a server-wide hashmap that stored the
collection key, id, and expiration timestamp for all objects
that had a TTL. The hashmap was occasionally probed at 20
random positions, looking for objects that have expired. Those
expired objects were immediately deleted, and if there was 5
or more objects deleted, then the probe happened again, with
no delay. If the number of objects was less than 5 then the
there was a 1/10th of a second delay before the next probe.

Now: Rather than a server-wide hashmap, each collection has
its own ordered priority queue that stores objects with TTLs.
Rather than probing, there is a background routine that
executes every 1/10th of a second, which pops the expired
objects from the collection queues, and deletes them.

The collection/queue method is a more stable approach than
the hashmap/probing method. With probing, we can run into
major cache misses for some cases where there is wide
TTL duration, such as in the hours or days. This may cause
the system to occasionally fall behind, leaving should-be
expired objects in memory. Using a queue, there is no
cache misses, all objects that should be expired will be
right away, regardless of the TTL durations.

Fixes #616
2021-07-12 13:37:50 -07:00
tidwall e60cbac7cf Merge distance updates 2021-07-08 07:03:36 -07:00
Mathieu 55e503c378 Add sasl 2021-07-08 06:46:57 -07:00
tidwall 5b3aeb5db7 add prometheus metrics endpoint 2021-07-08 06:46:52 -07:00
tidwall 48b46f2752 Update btree 2021-07-08 06:46:13 -07:00
tidwall 189de6496a Update BuntDB 2021-07-08 06:46:13 -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 eb407ab125 Fix invalid queue.db error 2021-07-08 06:36:45 -07:00
tidwall 5bbe2c3166 Upgrade go.mod 2021-07-08 06:36:41 -07:00
tidwall 657bbd80ca Upgrade gjson 2021-07-08 06:36:23 -07:00
tidwall 60678020fa Updated dependencies 2021-07-08 06:36:10 -07:00
tidwall d209edbd59 Updated rtree library 2021-07-08 06:36:10 -07:00
tidwall afd51f5dae Updated rtree library 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 c313a63603 Updated packages 2021-07-08 06:35:43 -07:00
tidwall f44bae43ca Replace tinybtree 2021-07-08 06:35:15 -07:00
tidwall 076cd4b009 Updated btree deps 2021-07-08 06:35:01 -07:00
tidwall e00d9763a6 Updated dependencies 2021-07-08 06:34:44 -07:00
tidwall 03662bb1fb Updated Kafka client 2021-07-08 06:34:09 -07:00
Mads Schou-Andreasen 37224791f4 added geofence webhook for GCP Pubsub 2020-05-19 17:11:31 +02:00
tidwall b3dc025545 Optimize point in ring 2020-03-25 15:07:14 -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 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 c567512600 Fix packages not vendoring on build 2020-02-11 11:02:15 -07:00
tidwall 2f907bd4c0 Update geojson
Fixes #529
2020-02-10 05:18:52 -07:00