Commit graph

3227 commits

Author SHA1 Message Date
Roman Gershman
51f400ac4a
fix: invalid reference inside GetQueueBackpressure (#4789)
thread_queue_backpressure is a global array of per thread QueueBackpressure
objects. We referenced these objects incorrectly in 1.27.0-2.

Fixes #4770

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-17 13:29:00 +00:00
mkaruza
345c2949d9
feat(server): Cluster MOVED response Prometheus metric (#4786)
* feat(server): Cluster MOVED response Prometheus metric

Get number of MOVED reported errors and send as Prometheus metric.

Closes #4749

Signed-off-by: mkaruza <mario@dragonflydb.io>

* Update help string

---------

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-03-17 15:05:07 +02:00
Borys
8ba7bd2c6d
Fix extended node info comparison (#4788)
* fix: extended node info comparison
2025-03-17 12:47:07 +00:00
Roman Gershman
66c2973a99
fix: removal of Expiry bit when overriding external strings (#4785)
The bug: during the override of the existing external string, we called
`TieredStorage::Delete` to delete the external reference. This function
called CompactObj::Reset that cleared all the attributes on the value, including
expiry.

The fix: preserve the mask but clear the external state from the object.
Fixes #4672

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-17 13:45:07 +02:00
Borys
151e40e2c0
feat: add node health status for CLUSTER SLOTS and SHARDS (#4767)
* feat: add node health status for CLUSTER SLOTS and SHARDS
2025-03-17 12:01:11 +02:00
adiholden
d75cfe8c9f
fix(cluster) : moved error port number on migration finish (#4776)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-17 10:38:29 +02:00
Roman Gershman
753c25e37c
fix: proper memory accounting for objects loaded via streaming (#4774)
The bug: during the loading when appending to the existing object,
ItAndUpdater scope did not account for the appended data, and as a result
`object_used_memory` and its variation did not account for streamed objects.

The fix: to extend the scope of the ItAndUpdater object to cover appends.
Added a sanity DCHECK that ensures that object_used_memory is at least as the memory used
by a single object. This dcheck fails pre-fix.

Fixes #4773

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-16 12:03:42 +02:00
Kostas Kyrimis
8acf849e9d
chore: clean up dbslice (#4769)
* merge AddOrFindResult with ItAndUpdater
* remove unused functions
* add missing FiberAtomicGuards on atomic member functions
2025-03-15 10:38:26 +02:00
Volodymyr Yavdoshenko
464dd0522e
fix: optional brackets were removed for ipv6 host (#4759)
fixed: IPv6 replication issues #4622
2025-03-15 10:23:13 +02:00
mkaruza
5facf12836
fix(test): Execute SSUBSCRIBE command directly in client (#4763)
Using `pubsub.ssubscribe` function doesn't wait for any response from
server. Fixed by switching to execute SSUBSCRIBE commands in client directly.

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-03-14 16:01:30 +01:00
Borys
8d6a18465b
feat: add node health status into config (#4758) 2025-03-13 09:20:02 +02:00
lichuang
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
Abhijat Malviya
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
adiholden
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
adiholden
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
Abhijat Malviya
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
lichuang
70e757f0b6
feat(server): extend populate command with expire (#4752) 2025-03-12 12:25:42 +02:00
mkaruza
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
Roman Gershman
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
Kostas Kyrimis
59a8c3634c
chore: replace chrono with absl in PipelineCacheSizeTracker (#4748)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-12 09:14:33 +02:00
Abhijat Malviya
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
Stepan Bagritsevich
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
Kostas Kyrimis
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
Roman Gershman
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
Kostas Kyrimis
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
Roman Gershman
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
adiholden
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
Abhijat Malviya
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
romange
c1cab562da chore(helm-chart): update to v1.27.2 2025-03-09 12:34:39 +00:00
Roman Gershman
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
Borys
57aa91fdb6
feat: allow cluster READONLY command (#4727)
* feat: allow cluster READONLY command
2025-03-09 09:27:33 +02:00
Borys
d8500c9686
refactor: move tl_cluster_config into cluster_config.cc (#4714) 2025-03-07 12:30:48 +02:00
Roman Gershman
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
mkaruza
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
adiholden
14c7e29207
Revert "chore: minor clean ups before introducing ProvidedBuffers (#4… (#4719)
* Revert "chore: minor clean ups before introducing ProvidedBuffers (#4709)"

This reverts commit a39d777b82.

* unrevert vscode

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-06 16:41:55 +00:00
Kostas Kyrimis
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
Abhijat Malviya
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
Roman Gershman
df88b9e1f8
fix: buffer overrun in GetRandomHex (#4717) 2025-03-06 15:56:17 +02:00
Roman Gershman
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
Stepan Bagritsevich
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
Volodymyr Yavdoshenko
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
Borys
700d375ffc
refactor: clean cluster code (#4707) 2025-03-06 10:08:16 +02:00
Roman Gershman
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
Kostas Kyrimis
9957e0412b
chore: update CONTRIBUTING.md (#4703)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-06 08:55:30 +02:00
Abhijat Malviya
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
Borys
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
Volodymyr Yavdoshenko
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
Kostas Kyrimis
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
Kostas Kyrimis
ad3161b2e7
chore: disable failing epoll tests (#4699)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-03-05 07:52:58 +00:00
Roman Gershman
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