Commit Graph

97 Commits

Author SHA1 Message Date
Kilowhisky 4b08376fad Add support for CORS in http requests 2024-05-06 16:12:44 -07:00
Josh Baker 9e869e04c3
Merge branch 'master' into exists 2024-03-24 22:54:40 -07:00
Chris Rice c17482afa4 Add EXIST and FEXIST command 2024-03-19 03:19:16 +00:00
Chris Rice 48394af724 Add FGET command 2024-03-18 20:10:04 +00:00
tidwall 6dd6e09af9 Allow healthz command without auth
Fixes #691
2023-07-31 04:51:14 -07:00
Chris Rice dbaa9c13a0 Add auth to allowed commands while data is loading
(cherry picked from commit 051605909e61bcc9251efaa350cb825436e06912)
2023-07-26 19:46:58 -07:00
tidwall add9873fef Added ROLE command
See #686
2023-05-21 08:22:27 -07:00
tidwall a8c92a07c1 Speed up leader/follower replication
This commit lowers the response time for a leader to send
updates to a follower. Should now be nearly instant.
2022-12-14 04:46:28 -07:00
tidwall 9c471e3f9c Replace out old style atomics 2022-11-03 10:07:17 -07:00
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