Commit graph

63 commits

Author SHA1 Message Date
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
Chaka
bcc3d3ec4f
fix(server):Return an error, instead of crashing, for requests trying to rename a key to the same key. (#897)
fix:Return an error, instead of crashing, for requests trying to rename a key to the same key.

Fixes #850

---------

Co-authored-by: Shahar Mike <shmike@google.com>
2023-03-02 21:46:27 +02:00
adiholden
086edd9707
feat(list family): impl rename journal commands (#704)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-01-19 14:34:25 +02:00
adiholden
160aeaa2d8
(generic family): journal support move command (#708)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-01-19 13:19:27 +02:00
Vladislav
45162b5c0a
feat(server): Journal rewrite p2 + tests (#699) 2023-01-19 13:55:50 +03: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
Vladislav
1eb227e318
feat(server): Rewrite journal commands (basic) (#651) 2023-01-16 14:52:46 +03:00
Vladislav
dd218fa037
feat(server): Json rdb support (#674) 2023-01-14 14:53:43 +03:00
Roman Gershman
d4cad11f86
chore: Refactor RdbLoad (#564)
Specifically, pass OpaqueObj to parsing routines so that they could fill it instead of creating it.
In addition, this change improves the interface between generic_family and RdbLoad code:
it removes reliance on the internal Item class.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-12-16 16:41:47 +02:00
Boaz Sade
3d610ee2d7
feat(server): JSON family using JSON type (#561)
feat(server): json family using json type

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
2022-12-14 19:25:10 +02:00
adiholden
d74b076e18
feat(rdb save): refactor move zstd serializer under rdb serializer (#533)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2022-12-06 13:28:19 +02:00
adiholden
574afe0143
feat(rdb save): serializer flush to sink only on flush call (#519)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2022-11-30 11:01:12 +02:00
adiholden
685b4411e8
feat(rdb save): add blob compression on snapshot (#505)
Signed-off-by: adi_holden <adi@dragonflydb.io>

Signed-off-by: adi_holden <adi@dragonflydb.io>
2022-11-29 11:12:51 +02:00
Roman Gershman
77ed4a22dd
fix: clang warnings. (#508)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-11-22 13:58:00 +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
Vladislav
96c9332297
feat(server): Switch to stable state replication (#473)
* feat(server): Switch to stable state replication

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2022-11-17 20:41:33 +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
b0bleet
acafbc6f4f
feat(server) implement pexpire command (#464)
Signed-off-by: b0bleet b0bleet@placeq.com
2022-11-06 22:07:41 +02:00
Leonardo Mello
efd307dbb9
feat(server): implement TOUCH command (#444)
Signed-off-by: Leonardo Mello <lsvmello@gmail.com>

Signed-off-by: Leonardo Mello <lsvmello@gmail.com>
2022-10-31 21:07:13 +02:00
Boaz Sade
b1470ba047
feat(server): support restore command - refactor load class (#343) (#386)
feat(server): adding support for the restore command (#343)

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
Co-authored-by: Boaz Sade <boaz@dragonflydb.io>
2022-10-18 11:13:16 +03:00
Roman Gershman
ffc25e6ac2
chore(server): Refactor expire functionality and move it to DbSlice (#388)
This is preparation for https://github.com/dragonflydb/dragonfly/pull/387

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-10-14 13:14:09 +03:00
Boaz Sade
ad014ebb86
fix(server): support for dump command, API update #343 (#371)
feat(server): adding support for the dump command (#343)

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
Co-authored-by: Boaz Sade <boaz@dragonflydb.io>
2022-10-13 11:32:45 +03:00
Boaz Sade
8f5500af16
feat(server): support for persist command #345 (#354)
fix(server): support for persist command #345

Co-authored-by: Boaz Sade <boaz@dragonflydb.io>
2022-10-04 15:53:18 +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
Vladislav
16b6b11cf2
feat(server): Implement MOVE command (#298)
* feat(server): Implement MOVE command

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Vladislav Oleshko <vlad@dragonflydb.io>
2022-09-18 20:57:12 +03:00
Roman Gershman
4e4ed63467
feat(server): tighten memory checks when inseting a new object. (#258)
Before this change Dragonfly evicted items only when it was low on memory and had to grow its main dictionary.
It is not enough because in many cases Dragonfly can grow in memory even when the main dictionary does not grow.
For example, when its dictionary is less than 90% utilized, but the newly added objects require lots of memory.

In addition, the dashtable adds additional segments, when other segments have enough available slots to fill the rest of the free memory.

This change adds another layer of defense that allows evicting items even when dictionary segments are not full.
The eviction is still local with respect to a segment. On my tests it seems that it's much harder to cross maxmemory limit than before.

In addition, we tightened the heuristic that allowes the dashtable to grow. Now it takes into account the average bytes per item
in order to project how much memory the full table takes before adding to it new segments.
This really improves dashtable utilization.

There are still things to improve:
1. the eviction behavior is rough. Once an insert does the eviction it tries to free enough objects to bring memory back.
   This may result in very spiky insertion/eviction patterns.
2. The eviction procedure, even though it's limited to a single segment, is quite heavy because it goes over all buckets
   in the segment. This may result in weird artifacts where we evict just enough to be under the limit, then add and evict
   again and so on.
3. Therefore, we may need a periodic eviction that will compliment this emergency eviction step.

Fixes #224 and partially addresses #256

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-08-26 15:00:08 +03:00
Vladislav
25e700f39f
feat(server): Implement STICK command #219 (#245)
* feat(server): Implement STICK command #219

Signed-off-by: Vladislav Oleshko <vladislav.oleshko@gmail.com>
2022-08-20 16:50:43 +03:00
odedponcz
3b04801cd6
fix: RENAMENX according to spec #229 (#230)
fix: RENAMENX according to spec #226

Signed-off-by: odedponcz <oded@poncz.com>
2022-08-07 22:49:21 +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
448d065647
fix(server): Fix a crash when running "client list" command. (#179)
Also, enhance release script to apply linker optimizations when building the binaries.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-26 17:25:42 +03:00
Roman Gershman
6b7d2a22df
chore(strings): Simplify Set flow (#164)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2022-06-19 23:19:42 +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
Roman Gershman
a9c0fa8ea4 Implement basic XADD, XRANGE, XLEN commands.
Covers most funvtionality for #59.
2022-06-08 22:04:49 +03:00
Roman Gershman
bb7b205bff Switch to using absl flags 2022-05-30 06:45:09 +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
6d44d72a56 Add more debugging tools for object introspection 2022-05-15 23:11:45 +03:00
Roman Gershman
1aa2a171ac Stats and debugging improvements. Provide some keyspace stats 2022-05-11 09:57:47 +03:00
Roman Gershman
72e90bb729 More work on blocking commands like BLPOP.
Fixes #1 and fixes #24.
2022-04-27 10:42:35 +03:00
Roman Gershman
d3d30fbbaf Add RenameNx. Fix #30 2022-04-25 15:41:41 +03:00
Roman Gershman
a5b59dde25 Add KEYS command 2022-04-19 11:38:32 +03:00
Roman Gershman
f113d29918 Fix several bugs.
Fix #17, also fix #14, fix #10 and fix #16.
2022-04-18 01:17:47 +03:00
Roman Gershman
bc92ace19c Add safe cursor API to dash table 2022-04-14 21:31:31 +03:00
Roman Gershman
997d2dcb69 more work on rdb load.
1. Added support of loading of compressed strings.
2. Verified we load expiry info.
3. Extended supported expiry period to 4 years (previously I set 1 year).
2022-04-13 10:50:19 +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
abbefd0bc4 More bug fixes.
1. RENAME now unblocks blpop/brpop.
2. Fix a deadlock bug with blpop running with the same key multiple times.
2022-04-06 10:32:42 +03:00