chore: remove cmd name from the list of arguments
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
The format as follows: `HSETEX key seconds field value [field value ...]`
This allows adding hset members with expiration time in seconds.
Fixes#687
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
SSCAN command support count and match parameters fixes#426
Signed-off-by: adi_holden <adi@dragonflydb.io>
Signed-off-by: adi_holden <adi@dragonflydb.io>
The bug was that when the hset had listpack encoding, it returned only keys instead of returning keys and values.
In addition, in preparation to having our own denset encoding for hset, I cleaned up the code and
introduced our own encoding constants for hset encoding.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Add SADDEX <key> <seconds> member member ....
Provides expiry semantics for set members with seconds resolution.
Important things to note:
1. The expiry is passive only, so if nobody touches that set then its members are being kept.
2. SCARD provides an upper bound estimation of set size for sets holding the expiring members.
The reason for this is because SCARD returns a cached size and does not go over all members
to check whether they expired. For regular sets it's exact, of course.
Fixes#335
Partially implements #6.
Before, each shard lazily updated its clock used for the expiry evaluation.
Now, the clock value is set during the transaction scheduling phase and is assigned
to each transaction. From now on DbSlice methods use this value when checking whether
the entry is expired via passed DbContext argument.
Also, implemented transactionally consistent TIME command and
verify that time is the same during the transaction. See
https://ably.com/blog/redis-keys-do-not-expire-atomically for motivation.
Still have not implemented any lamport style updates for background processes
(not sure if it's the right way to proceed).
* feat(core): Added DenseSet & StringSet types with docs
- Improved documentation by adding labels to chain types & pointer tagging table
- Added potential improvements to the DenseSet types in the docs
- Added excalidraw save file for future editing
- Removed ambiguous overloading types
- Renamed iterators to be more clear
* feat(core): Cleaned up DenseSet and Docs
* feat(core): Made DenseSet more ergonomic
* feat(server): Integration of DenseSet into Server
- Integrated DenseSet with CompactObj and the Set Family commands
Signed-off-by: Braydn <braydn.moore@uwaterloo.ca>
This statistic helps understanding how much Dragonfly memory grows via updating the existing value vs the new ones.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. No entries data is written into a journal yet.
2. Introduced a state machine to start and stop journal using a new auxillary command "dfly".
3. string_family currently calls an universal command Journal::RecordEntry that should
save the current key/value of that entry. Please note that we won't use it for all the operations
because for some it's more efficient to record the action itself than the final value.
4. no locking information is recorded yet so atomicity of multi-key operations is not preserved for now.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Related to #159. Before this change, rdb loading thread has been creating all the redis objects as well.
Now we separate rdb file parsing and objects creation. File parsing phase produces a load trace of one or more binary blobs.
Those blobs are then passed to the threads that are responsible to manage the objects.
The second phase is object creation based on the trace that was passed. Finally those binary blobs are destroyed.
As a result, each thread creates objects using the memory allocator it owns and memory stats become consistent.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Make EngineShardSet to be a process singleton instead of a variable passed everywhere.
2. Implement a heuristic of updating free memory per shard.
3. Make sure that SET command returns OOM when a database reaches its limits.
1. Basic support of sets and hsets. No intset or dict-based hset yet.
2. Make sure that rdbloader actually loads the data into shards.
3. Support object metadata like expiry time.
4. Support lists loading.
1. Sets do not use anymore redis encoding constants in our codebase.
2. rdb_save serializes now expiry information as well.
3. db_slice provides a simplified api to translate from absolute time to ExpirePeriod.
4. common_types.h is renamed to common.h. cached memory usage variables are moved there.