Commit Graph

88 Commits

Author SHA1 Message Date
tidwall bdc80a7f70 Added WHERE expressions
It's now possible to do:

   SCAN fleet WHERE "properties.speed < 25 || properties.speed > 50"

Uses javascript-like syntax using the https://github.com/tidwall/expr package.

Automatically reference fields and GeoJSON properties:

   SET fleet truck1 FIELD speed 65 POINT -112 33

Can be queried:

   SCAN fleet WHERE "speed > 50"
   SCAN fleet WHERE "id == 'truck1'"
   SCAN fleet WHERE "speed > 50 && id == 'truck1'"
2022-10-20 17:01:12 -07:00
tidwall e1df4dbf78 Better OUTPUT tests 2022-09-27 14:19:57 -07:00
tidwall 8608ed0917 Replace abool/aint with new go 1.19 atomics 2022-09-27 10:15:31 -07:00
tidwall 46927b476f Better TEST tests 2022-09-27 08:18:17 -07:00
tidwall 659160289c Better READONLY tests 2022-09-26 17:58:51 -07:00
tidwall ad8d40dee5 Better AOF/AOFMD5 tests 2022-09-26 15:43:14 -07:00
tidwall c093b041e1 Parallel integration tests 2022-09-26 13:26:46 -07:00
tidwall 906824323b More graceful Tile38 shutdown 2022-09-25 06:28:17 -07:00
tidwall 13ceb7da41 Removed global variables from core package
The core package uses global variables that keep from having
more than one Tile38 instance runnning in the same process.

Move the core variables in the server.Options type which are
uniquely stated per Server instance.

The build variables are still present in the core package.
2022-09-24 15:44:32 -07:00
tidwall 0301545fe6 Better INFO tests 2022-09-24 14:28:47 -07:00
tidwall d8ecbba0be Better CLIENT tests 2022-09-24 13:41:36 -07:00
tidwall e6cced4c4a Fix hang on empty RESP response 2022-09-24 07:22:39 -07:00
tidwall 5460998086 wip - fixing the empty response error 2022-09-24 06:22:58 -07:00
tidwall 9c8e7e90e1 Clean up some tests 2022-09-23 17:54:49 -07:00
tidwall 5c455cbe10 Better HEALTHZ tests 2022-09-23 17:34:09 -07:00
tidwall 5bcef43894 Better KEYS tests 2022-09-23 16:12:32 -07:00
tidwall 295a9c45a8 Better SET/PERSIST/TTL/STATS tests 2022-09-23 15:29:46 -07:00
tidwall 7fa2dc4419 Better FSET tests
Execute oom check immediately after setting maxmemory
2022-09-23 12:42:39 -07:00
tidwall 960c860b3a Better RENAME/RENAMENX tests 2022-09-23 11:18:01 -07:00
tidwall ede1ce0269 Better GET/DROP tests 2022-09-23 10:42:43 -07:00
tidwall db380a4fee Better DEL/PDEL/TYPE tests 2022-09-23 09:04:01 -07:00
tidwall ef95f04aca Better coverage BOUNDS 2022-09-23 07:51:05 -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 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 023433a963 Fix server hang on shared address 2022-09-12 16:38:45 -07:00
tidwall fc39090e94 Workaround for lettuce handshake to work.
Issue #636
2022-03-10 12:44:40 -07:00
Benjamin Ramser 407fd4c71c refactor: set log encoding early 2021-12-27 12:20:14 +01: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 29a6d05f3f Minor refactor 2021-12-09 09:24:26 -07:00
tidwall 9e552c3629 Allow some basic client commands before AOF data loads
This commit accepts incoming connections even before the AOF
dataset has been loaded into memory. Though only a very limited
command set is allowed.

Allowed commands:
  PING, ECHO, OUTPUT, QUIT

All other commands will return:
  LOADING Tile38 is loading the dataset in memory

This is useful for establishing connections for the purpose of
checking process and network state.
2021-10-01 17:18:07 -07:00
tidwall 18438e5783 Use same input args for command functions 2021-09-13 10:52:20 -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 83094b2740 Update hook expiration logic 2021-09-12 09:55:58 -07:00
tidwall 06a92d8a21 Increase the precision of TIMEOUT
This commit ensures that the TIMEOUT is always checked prior to
returning data to the client, and that the elapsed command time
cannot be greater than the timeout value.
2021-09-08 11:07:07 -07:00
tidwall a737a78d6f Add unix socket support 2021-09-07 05:51:15 -07:00
tidwall fc4a627aa6 Use struct for server options 2021-09-06 08:55:13 -07:00
tidwall c8389fe52c Fix memory leak with group id
This commit fixes a memory leak that was being caused by hooks
hanging on to the geofence group ids past the life of the object.
2021-08-20 05:00:14 -07:00
tidwall 694ad1fb62 Update btree/buntdb 2021-07-31 07:42:58 -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 d2f747933f clear linter messages 2021-07-10 03:59:27 -07:00
tidwall df8d3d7b12 Close follower files before finishing aofshrink
fixes #449
2021-06-13 07:53:27 -07:00
tidwall 30c3e81e0d 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-05-25 16:36:49 -07:00
Oliver 6b0282d960 add more metrics, add metrics index page 2021-05-13 21:14:05 -04:00
Oliver 30f7226705 add prometheus metrics endpoint 2021-05-13 21:14:04 -04:00
tidwall 47a4e16c0b Add comment 2021-04-28 05:09:48 -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 72dfaaec63 Updated dependencies 2021-02-07 17:54:56 -07:00
tidwall 016f397124 Replace tinybtree 2021-01-25 14:34:40 -07:00
tidwall 1a7d8d6431 Added ENV var for 500 http errors 2020-11-07 05:22:11 -07:00