Commit graph

48 commits

Author SHA1 Message Date
Vladislav
eda941dca6
fix: add Transaction::Conclude (#1606)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-07-31 15:37:29 +03:00
Roy Jacobson
912843d698
chore: Add a basic clang-tidy config (#1192)
* chore: Add .clang-tidy file

* Fix some problems and non-problems
2023-05-07 22:46:52 +03:00
Roy Jacobson
8749d736dd
chore: Update comments and logs after debugging (#1129) 2023-04-25 08:37:23 +03:00
Vladislav
a12ddfe108
Remove cmd name from args (#1057)
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>
2023-04-10 14:14:52 +03:00
Vladislav
72f67eddd8
refactor(facade): Refactor reply builder (#991)
Refactor RedisReplyBuilder to simplify method overloads
2023-03-26 12:52:40 +03:00
ashotland
39174f398a
feat(server): Support Resp3 (#975)
Accept hello 3 command and switch to resp3 response format.

---------

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-22 12:18:29 +02:00
Roman Gershman
d165994b88
feat(server): Add HSETEX command (#817)
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>
2023-02-22 14:01:56 +02:00
adiholden
d660787c6b
test(replica): test journal rewrite with multi shards (#720)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-01-24 14:31:25 +02:00
adiholden
f175127837
(generic family): journal support rename command (#698)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-01-18 12:14:18 +02:00
Vladislav
9536c0a645
Refactor transaction (#697)
* refactor(server): Transaction naming

Signed-off-by: Vladislav <vlad@dragonflydb.io>
2023-01-17 14:53:12 +02:00
adiholden
1f5811fb78
feat(set family): rewrite set store commands to journal (#691) 2023-01-17 00:27:11 +03:00
Vladislav
1eb227e318
feat(server): Rewrite journal commands (basic) (#651) 2023-01-16 14:52:46 +03:00
Roman Gershman
69b00b9cdd feat(server): Integrate set_map into hset_family
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-12-24 17:21:57 +02:00
Boaz Sade
235ff67e44
fix(server): all scan commands needs to return cursor as bulk string #503 (#504)
fix(server): scan cursor returning bulk string #503

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
2022-11-21 20:18:38 +02:00
adiholden
22f8554680
SSCAN command support count and match parameters (#466)
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>
2022-11-09 23:33:54 +02:00
Roman Gershman
10c3d9f666
fix(hset): fix hset match bug (#411)
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>
2022-10-20 14:16:16 +03:00
SALEH
45a5f30cdd
feat(server): Implement SMISMEMBER command (#377)
* feat(server): Implement SMISMEMBER command (#361)

Signed-off-by: ATM SALEH <saleh.cse08@gmail.com>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2022-10-13 05:21:27 +03:00
Roman Gershman
d2b216077d
feat(setfamily): Add SADDEX command (#348)
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
2022-10-03 13:15:27 +03:00
Roman Gershman
44f98de128
chore(denseset): Simplify DenseSet, remove empty links. (#339) 2022-10-01 06:58:37 +03:00
Roman Gershman
0925829afb feat(server): Introduce transaction clock.
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).
2022-09-25 23:53:08 +03:00
Vladislav
0377481e28
feat(server): SORT command prototype (#311)
feat(server): Implement SORT

Fixes #287

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Vladislav Oleshko <vlad@dragonflydb.io>
2022-09-23 07:17:49 +03:00
Roman Gershman
de9369f518
chore(server): update license text (#312) 2022-09-19 09:01:10 +03:00
Braydn
b8d791961e
feat(core): Added DenseSet and StringSet types (#268)
* 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>
2022-09-14 08:41:54 +03:00
Vladislav
cb024a23ac
feat(server): Watch & Unwatch commands (#277)
* chore(server): Refactor ConnectionState & DbSlice for watched key support

* feat(server): Add WATCH & UNWATCH commands

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Vladislav Oleshko <vlad@dragonflydb.io>
2022-09-13 19:14:11 +03:00
Roman Gershman
1ed81cf61d chore(set): minor cleanups and refactorings. (#260) 2022-08-27 10:18:54 +03:00
Roman Gershman
cf991deb03 chore(server): add updateval_amount statistic.
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>
2022-08-02 11:03:46 +03:00
Roman Gershman
3bbdb8e4b1
feat(journal): Introduce basic journal support. (#211)
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>
2022-07-17 21:12:50 +03:00
Roman Gershman
55389d9be5
chore(rdb): move object creation during loading to shard threads. (#188)
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>
2022-07-04 19:08:13 +03:00
Roman Gershman
da3ae760d5 feat(stream): implement rdb save support for streams
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-18 20:08:09 +03:00
Ryan Russell
eae5c08e76
Improve Comment Readability (#69)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-05-31 23:07:00 +03:00
Roman Gershman
9eb13b5163 Cover more type families with OOM checks 2022-05-19 12:00:47 +03:00
Roman Gershman
797c8121b1 Limit table growth according to maxmemory.
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.
2022-05-16 08:19:32 +03:00
Roman Gershman
c34e7c6d44 Implement ZUNIONSTORE.
Fix some bugs in transactional framework to support irregular commands.
Lay out groundwork for supporting XXX-STORE other commands in zsets.
2022-05-07 20:38:18 +03:00
Roman Gershman
362f1f4ec4 Integrate UpdateHooks into set-family code 2022-04-29 19:54:41 +03:00
Roman Gershman
bfcefd932d Support rdb loading.
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.
2022-04-12 16:39:25 +03:00
Roman Gershman
5ef63f41d2 Fix bugs related to error reporting.
1. Fix #9
2. SINTER now reports error if some of its keys are of wrong type.
2022-04-07 12:01:18 +03:00
Roman Gershman
d03cea5e36 Code simplifications.
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.
2022-04-07 11:01:10 +03:00
Roman Gershman
37f09f315e Implement MATCH and TYPE options for the SCAN command 2022-03-31 12:08:45 +03:00
Roman Gershman
39ef7bf630 Fix SDIFFSTORE bug 2022-03-30 02:04:49 +03:00
Roman Gershman
cb14df0e6b Add SSCAN command.
Update README with 2.x API commands.
2022-03-23 17:54:25 +02:00
Roman Gershman
f1ea69c0b4 Fix SDIFF/SINTER commands 2022-03-22 23:50:47 +02:00
Roman Gershman
c533ffb692 switch back to dict implementation for set due to sscan command 2022-03-22 20:53:54 +02:00
Roman Gershman
29c715fda5 Add more list commands 2022-03-15 19:52:11 +02:00
Roman Gershman
71272c4ee1 Implement SPOP action 2022-03-06 18:18:29 +02:00
Roman Gershman
c94d109cff Use FlatSet for Redis SETS
Add FlatSet data structure.
Use FlatSet and get rid of t_set functions.
Fix Hash bug. Add memory comparison test
2022-03-05 20:20:30 +02:00
Roman Gershman
3f0fcbf99f Factor out client connections module into a separate library called facade 2022-03-03 01:59:29 +02:00
Roman Gershman
28a2db1044 Implement hset method 2022-03-02 19:06:49 +02:00
Roman Gershman
668a51cafa Add most of SET commands (SADD, SCARD etc). Add set_family_test 2022-02-27 22:44:22 +02:00