3217 Commits

Author SHA1 Message Date
8d6a18465b feat: add node health status into config (#4758) 2025-03-13 09:20:02 +02:00
93bd52ceb8 feat(server): extend populate command with expire, fix bug that expire the same key for multiple time (#4757)
* feat(server): extend populate command with expire, fix bug that expire the same key for multiple time
2025-03-12 14:21:59 +00:00
ac33cd871b feat(metrics): Add label for main and other listeners (#4739)
* feat(metrics): Add label for main and other listeners

The stats collected per connection are divided according to main or
other listener.

Metrics are decorated with labels listener= main or other.

The memcached listener is also labelled as main.

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-03-12 18:33:04 +05:30
0e35f788ec fix(server): hmget non uniqe keys response (#4745)
* fix server: hmget non uniqe keys response

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-12 12:50:58 +00:00
93ac813eb1 fix test: test_replication_all increase key num (#4747)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-12 13:40:43 +02:00
616a708ad9 chore: Handle hsetex options in any order (#4754)
NX and KEEPTTL can be specified in any order, but only one of each or
both must be specified.

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-03-12 16:14:05 +05:30
70e757f0b6 feat(server): extend populate command with expire (#4752) 2025-03-12 12:25:42 +02:00
b6a94e9d59 feat(server): Support dynamic cloud storage SAVE path (#4729)
Add functionality to use SAVE and BGSAVE commands with dynamic CLOUD storage path.

New syntax is:

SAVE [RDB|DF] [CLOUD_URI] [BASENAME] where CLOUD_URI should start with S3 or GCS prefix.

For example, now it should work to have working directory pointing to some local folder and executing 
command `SAVE DF s3://bucket/snapshots my_snapshot` would save snapshots to `s3://bucket/snapshots` 
with basename `my_snapshot`.

Resolves #4660

---------

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-03-12 09:46:18 +01:00
51dd6d1bd2 feat: allow non-ascii values in dfly_bench (#4751)
binary strings are supported by RESP protocol so we now generate commands
using this protocol, so that we could pass binary strings.

In addition, fixed "done" metric which did not account for number of shards
cluster mode.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-12 09:48:05 +02:00
59a8c3634c chore: replace chrono with absl in PipelineCacheSizeTracker (#4748)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-12 09:14:33 +02:00
611e9b3f2c feat(hset_family): Add KEEPTTL support to HSetEx (#4730)
* feat(hset_family): Add support for KEEPTTL to HSETEX

The KEEPTTL option if specified makes sure that TTL is preserved for existing members.

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-03-12 11:23:15 +05:30
4f70d1bdbc fix(transaction): Fix auto journaling in transaction (#4737)
* fix(transaction): Fix auto journaling in transaction

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>

* refactor: address comments

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>

---------

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-03-10 16:04:58 +00:00
2ff8603492 fix: enforce strong consistency in channel_store (#4740)
Channel store uses a read-copy-update to distribute the changes of the channel store to all proactors. The problem is that we use memory_order_relaxed to load the new pointer to the channel store for each proactor which *does not guarantee* that we fetch the latest value of the channel store. Hence, the fix is to use sequencial consistency such to force fetch the latest value of the channel store.
2025-03-10 17:50:28 +02:00
74f5f149bd feat: add an option to start using iouring provided buffers (#4736)
iouring allows to register a pool of predefined buffers used by kernel.
then during the recv operation the kernel will choose a buffer from the pool, copy data into it
and return it to the application. This is in contrast to prealocate buffers that need to be passed to
a regular Recv. So, for example, if we have 10000 connections, today we preallocate 10000 buffers,
even though we may have only 100 in-flight requests.

This PR does not retire the old approach, but extends with the new once
with the flag `--uring_recv_buffer_cnt=N` that specifies how many receive buffers per thread to preallocate.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-10 10:49:49 +02:00
897be04d4a feat: dfly acl select (#4696)
Add dragonfly acl extension $ rule to allow or block users from using a specific logical database.

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-10 07:57:00 +00:00
8071a48e98 chore: improve debug compression (#4735)
Now the debug compression command runs over all the keys to count the histogram.
Based on the histogram it estimates potential savings for huffman compression of the keyspace.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-09 16:20:55 +00:00
17ebb35aca server: control cluster migration speed with flag (#4734)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-09 16:25:47 +02:00
50a4bfd3cb chore: Add clion build path to gitignore (#4732)
chore: Add clion/intellij paths to gitignore

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-03-09 19:36:29 +05:30
c1cab562da chore(helm-chart): update to v1.27.2 2025-03-09 12:34:39 +00:00
7c0eed629e fix: improve stack margin for s3 related operations. (#4731)
fix: improve stack margin for s3 operations.

our S3 code relies on aws sdk client, which is extremely stack hungry.
this PR moves some of s3 calls to one-off fibers with increased stacks,
which reduces stack usage for connection fibers executing snapshot save/load operations.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-09 14:26:23 +02:00
57aa91fdb6 feat: allow cluster READONLY command (#4727)
* feat: allow cluster READONLY command
2025-03-09 09:27:33 +02:00
d8500c9686 refactor: move tl_cluster_config into cluster_config.cc (#4714) 2025-03-07 12:30:48 +02:00
e01aec2a21 fix(dfly_bench): track hit rate for mget command (#4723)
Also, clean up the code a bit, reduce nesting.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-07 07:09:59 +00:00
76f36cdc57 feat(server): Add PUBSUB SHARDCHANNELS/SHARDNUMSUB (#4702)
Add support for PUB SHARDCHANNELS and PUB SHARDNUMSUB and report error back if 
sub command is not allow to run in non cluster mode.

resolves #847

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-03-06 18:53:21 +01:00
14c7e29207 Revert "chore: minor clean ups before introducing ProvidedBuffers (#4… (#4719)
* Revert "chore: minor clean ups before introducing ProvidedBuffers (#4709)"

This reverts commit a39d777b82138bcafb1b67c09927ef3f166755f9.

* unrevert vscode

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-06 16:41:55 +00:00
0a6c28d904 fix: preemption in atomic section of heartbeat (#4720)
The bug is that expiring keys during heartbeat should not preempt while writing to the journal and we assert this with a FiberAtomicGuard. However, this atomicity guarantee is violated because the journal callback acquires a lock on a mutex that is already locked by on OnJournalEntry(). The fix is to release the lock when OnJournalEntry() preempts.

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-06 18:01:18 +02:00
5f2dbb71a2 feat(set_family): Add support for KEEPTTL to SAddEx (#4712)
When `KEEPTTL` is optinally supplied after key, any existing members in the set will preserve their TTL values. 

Only new members will get TTL applied to them.
2025-03-06 21:09:57 +05:30
df88b9e1f8 fix: buffer overrun in GetRandomHex (#4717) 2025-03-06 15:56:17 +02:00
94d9cf79ef fix(dfly_bench): support dns resolution for cluster hosts (#4715)
fix(dfly_bench): support dns resolution for cluster hosts and multiple slot ranges.

Initial parsing of MOVED response is done but slot migration is not supported yet.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-06 11:46:58 +00:00
5ffe939b3d fix(json_family): Fix JSON.SET handling for nested fields (#4710)
fixes dragonflydb#4381

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-03-06 09:53:23 +01:00
faf626eed4 fix: Remove the dfly logo print from pytest run #4682 (#4706)
fixed: https://github.com/dragonflydb/dragonfly/issues/4682
2025-03-06 10:27:58 +02:00
700d375ffc refactor: clean cluster code (#4707) 2025-03-06 10:08:16 +02:00
a39d777b82 chore: minor clean ups before introducing ProvidedBuffers (#4709)
Making RedisParser::Buffer const, some minor changes in dragonfly_connection code.

No functionality is changed.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-06 09:51:39 +02:00
9957e0412b chore: update CONTRIBUTING.md (#4703)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-06 08:55:30 +02:00
e2a2b3e73e feat(set_family): Update TTL for existing fields in SADDEX (#4700)
* feat(set_family): Update TTL for existing fields in SADDEX

In SADDEX a TTL is now also applied to existing fields, if the field
already exists in set, its TTL is updated.

A new flag legacy_saddex_keepttl is introduced which is false by
default. If this flag is set to true, then SADDEX keeps legacy behavior.

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>

---------

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-03-06 12:22:20 +05:30
4d300f8a58 fix: prevent tx_executor reading from sock if operation is canceled (#4704)
fix: prevent tx_executor reading from sock if operations is canceled
2025-03-05 14:00:03 +02:00
28e1a48781 fix: ZMSCORE return value if key does not exist (#4697)
* tests were added

* bug has been fixed

* formatting was fixed

* review comments have been fixed

* outdated comment has been removed
2025-03-05 10:27:59 +00:00
2644d69239 feat: client unpause and client help (#4630)
Implement client unpause and client help.

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-05 11:20:49 +02:00
ad3161b2e7 chore: disable failing epoll tests (#4699)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-05 07:52:58 +00:00
b53de2e34e chore: snapshot/tiering improvements (#4661)
Mainly comments and refactorings.

There are two functional differrences:
1. flush serialized entries in case we gathered at least K delayed
entries coming from tiered entities.
2. allow loading snapshots larger than memory for tiered enabled datastores.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Kostas Kyrimis <kostas@dragonflydb.io>
2025-03-05 09:43:23 +02:00
5625aa421d chore: Add debug logs to help tracking transactional deadlocks (#4669)
* chore: reproduce a bug related to #4663

Add various debug logs to help tracking the deadlock.

Add more assertions in helio and provide state time for fibers
during stacktrace printings.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-04 16:33:13 +02:00
028e08076a chore: add debug printings to SetExisting (#4694)
Some checks failed
Regression Tests / build (Debug, ubuntu-dev:20, Uring, [self-hosted linux ARM64]) (push) Has been cancelled
Regression Tests / build (Debug, ubuntu-dev:20, Uring, ubuntu-latest) (push) Has been cancelled
Regression Tests / build (Release, ubuntu-dev:20, Uring, [self-hosted linux ARM64]) (push) Has been cancelled
Regression Tests / build (Release, ubuntu-dev:20, Uring, ubuntu-latest) (push) Has been cancelled
Regression Tests / lint-test-chart (push) Has been cancelled
Epoll Regression Tests / build (Debug, ubuntu-dev:20, Epoll, [self-hosted linux ARM64]) (push) Has been cancelled
Epoll Regression Tests / build (Debug, ubuntu-dev:20, Epoll, ubuntu-latest) (push) Has been cancelled
Epoll Regression Tests / lint-test-chart (push) Has been cancelled
Should help debugging #4672

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-04 14:52:36 +02:00
ea6fdadd67 fix: possible preemption under FiberAtomicGuard (#4692)
1. Fix FreeMemWithEvictionStep that could preempt under FiberAtomicGuard.
   This could happen during the return from the inner loop. Now, we break
   from the guard first and then preempt in a safe place.
2. Rename LocalBlockingCounter to LocalLatch
   because it's a variation of latch (see std::latch for example).
3. Rename PreUpdate to PreUpdateBlocking to emphasize it can block.
4. Fix mutations counting: consider either insertions or changing the existing entry.
   Before that we incremented this counter for misses as well.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-04 14:28:34 +02:00
debb2eb9e8 feat(cluster_mgr): Add argument to set path to dragonfly binary (#4695)
Add optional argument to cluster_mgr script so that we can run cluster with different builds.

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-03-04 12:52:24 +01:00
b729a268ca feat: Added a flag to ignore key expiry. (#4667)
feat(rdb_load): Added a flag to ignore key expiry #3858.

Added a new flag --rdb_ignore_expiry to ignore key expiry when loading from RDB Snapshot. Also cached this flag into RDBLoader object to reuse it.
2025-03-04 08:36:01 +00:00
2311d87d90 fix(metrics): add corresponding comments to command metrics (#4674)
---------

Signed-off-by: Lewis <lewis@ourzora.com>
2025-03-04 10:30:55 +02:00
d8a9ad40b0 fix(server): deadlock with replicaof inside multi (#4685)
* fix server: fix deadlock with replicaof inside multi

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-04 09:48:18 +02:00
a1e7535e63 fix: reduce stack usage on Fedora (#4690)
FormatInfoMetrics used 18KB of stack size in debug mode.
Each call to append increased the stack even though the calls were done
from the scope blocks. This PR overcomes this by move the calls to lambda functions.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-04 09:41:44 +02:00
618af313ca fix: SendInvalidationTrackingMessage should not block. (#4680)
Some checks failed
Development Docker Build / Build and Push alpine amd64 image (push) Has been cancelled
Development Docker Build / Build and Push alpine arm64 image (push) Has been cancelled
Development Docker Build / Build and Push ubuntu amd64 image (push) Has been cancelled
Development Docker Build / Build and Push ubuntu arm64 image (push) Has been cancelled
Development Docker Build / merge_manifest (alpine) (push) Has been cancelled
Development Docker Build / merge_manifest (ubuntu) (push) Has been cancelled
We call PerformDeletion in an atomic block, which in turn calls SendInvalidationTrackingMessage
that could block. We fix it by separating the blocking logic by moving the invalidation messages into
a designated send queue and flush it later.

In addition rename the function to make it explicit that they are atomic (i.e. not blocking).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-03 14:32:57 +02:00
cf3eb8f05f chore: cluster related clean ups (#4683)
Adding comments plus some missing include headers.
No functional changes.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-03 14:32:41 +02:00