Commit graph

3387 commits

Author SHA1 Message Date
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
Roman Gershman
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
Roman Gershman
028e08076a
chore: add debug printings to SetExisting (#4694)
Should help debugging #4672

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-04 14:52:36 +02:00
Roman Gershman
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
mkaruza
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
Harshit Gupta
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
Lewis
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
adiholden
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
Roman Gershman
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
Roman Gershman
618af313ca
fix: SendInvalidationTrackingMessage should not block. (#4680)
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
Roman Gershman
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
Roman Gershman
77b9a8f699
chore: introduce DEBUG COMPRESSION (#4620)
This function analyzes the compressability of the keys
using a single huffman tree. For example,

```
>debug POPULATE 1000000 keyabcdef 10
OK

> debug compression
 1) max_symbol
 2) (integer) 121
 3) max_bits
 4) (integer) 5
 5) raw_size
 6) (integer) 7861817
 7) compressed_size
 8) (integer) 4372270
 9) ratio
10) "0.5561398847111297"
```

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-02 21:29:19 +02:00
Stepan Bagritsevich
afad75f17b
fix(search_family): Add option tests for the FT.CREATE command (#4678)
fixes dragonflydb#4677

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-03-02 13:27:41 +01:00
Roman Gershman
680e1e26c3
chore: refactor ServerFamily::Info (#4671)
Also, allow printing Metrics in tests.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-28 08:33:06 +00:00
Borys
4da1678d5e
feat: add migration error statistic (#4643)
* feat: add migration error statistic
2025-02-27 13:38:06 +02:00
Kostas Kyrimis
ad062a3c93
fix: replication error message and scan command yield (#4665)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-27 11:52:30 +02:00
adiholden
7c2051ef71
CI: add slow regression tests (#4646)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-27 09:01:57 +00:00
Roman Gershman
fff49e0e1f
Support Cluster configuration for dfly_bench (#4664)
Support Cluster configuration for dfly_bench.

The load tester client opens a connection to each shard, in total
`num_shards * FLAGS_c * FLAGS_proactor_threads` connections.

There is no support for MOVED responses at the moment so only static clusters are supported.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-26 19:45:54 +02:00
Kostas Kyrimis
8512f726f4
fix: race condition in ReplicaOfInternal (#4653)
#4636 introduced a small race . The problem is that Start() might have failed (because a subsequent ReplicaOf command cancelled it). ReplicaOfInternal would ignore the ec and start the replication fiber via replica_->StartMainReplicationFiber but the second ReplicaOf command that followed updated replica_ so we tried to start replication twice on the same replica instance triggering a check failed that the fiber is running.

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-26 14:30:49 +02:00
adiholden
a213d96b6c
server: disable single shard tx optimization on scheduling (#4647)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-26 14:02:54 +02:00
Kostas Kyrimis
ebccc25795
chore: replace try assert false with pytest.raises (#4662)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-26 12:26:21 +02:00
Roman Gershman
7e47cfc5ca
fix: do not crash upon inconsistent expire iterator (#4658)
Fixes #4656

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-25 11:21:44 +00:00
Roman Gershman
fc65a1acfd
fix: bring back the helm step to docker release action (#4657)
Also, add the missing notifications.
Fixes #4633

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-25 11:42:12 +02:00
romange
df0e3e2a16 chore(helm-chart): update to v1.27.1 2025-02-25 08:03:00 +00:00
Kostas Kyrimis
692967ac6d
chore: unsubscribe pub/sub connections after cluster migration (#4529)
* unsubscribe pub/sub connections for migrated slots
* add test

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-24 18:54:08 +02:00
Roman Gershman
4fe6dabd3c
fix: pull latest helio (#4651)
Latest helio fixes the bug in DnsResolve - fixes #4244

Also, add some comments and perform minor clean ups in tiered codebase.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 17:00:54 +02:00
Roman Gershman
fa9569062b
feat: implement unique keys counting using hll (#4652)
HyperLogLog is an efficient data structure for approximate counting of unique elements.
We use it to sample the traffic via "DEBUG KEYS ON/OFF" command.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 15:47:29 +02:00
Roman Gershman
91a3dd8283
chore: allow sampling of topk hottest keys. (#4649)
* chore: allow sampling of topk hottest keys.

The core data structure code was added long time ago, now
we allow using it via `DEBUG TOPK ON/OFF` subcommand.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 11:30:10 +00:00
Roman Gershman
3812ab8542
chore: add listpack statistics to objhist (#4650)
Also, make the report a bit clearer.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 12:41:30 +02:00
Roman Gershman
5b986f7526
chore: get rid of lispack stats (#4644)
They were wrong, we usually do not need them,
and they complicated code. The right way to do it - to add them to OBJHIST statistics.

In addition, did some other code improvements without functional changes.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 09:04:49 +02:00
Roman Gershman
2d8c5b8c00
fix: performance degradation with Reflex matching (#4634)
1. cherry-pick valkey security fixes with stringmatchlen with exponential complexity of stars
   See https://nvd.nist.gov/vuln/detail/cve-2022-36021
2. Fallback to stringmatchlen for short lengths.
3. Add another backend to GlobMatcher - PCRE2, though do not enable at the moment.
   While this backend is the fastest one - it requires an additional shared lib dependency.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-24 08:47:42 +02:00
Kostas Kyrimis
493059fa7f
fix: do not flush replicaof if failed to connect (#4636)
We unconditionally flushed the replica even if replicaof failed to connect. We now flush only if replicaof succeeded to connect.

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-21 12:58:25 +02:00
Roman Gershman
96ab1c1ec0
fix: improve test_send_delay_metric test (#4642)
Also, fix a small bug in ok_backend

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-21 12:01:32 +02:00
Roman Gershman
54b864b2c7
chore: get rid of sds in SortedMap::AddElem (#4638)
chore: get rid of sds in SortedMap functions

Switch them to string_view interfaces.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-21 11:07:53 +02:00
Roman Gershman
8226d555c6
chore: propagate reserve data upon restore (#4641) 2025-02-21 10:24:41 +02:00
Roman Gershman
f3f04de9e0
fix: invalid BUSYKEY response (#4637)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-20 17:39:46 +00:00
Roman Gershman
636cc852b8
chore: Improve loading of sorted sets (#4631)
1. Reduce number of allocations when creating new members
2. Reverse the saving order because with bptree it's better to add elements
   from the smallest to largest.
3. Add a runtime flag rdb_load_dry_run that allows us to load the dataset
   without actually adding entries.

For zset rich dataset, the difference was 415s before vs 220s afterwards.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-20 16:14:55 +00:00
adiholden
6c4878fcb1
fix(server): redis parser reject big bulk read (#4627)
introduces a flag max_bulk_len

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-20 17:16:17 +02:00
Roman Gershman
59719a1723
chore: remove redundant calls to GetSlice (#4635) 2025-02-20 17:14:43 +02:00
adiholden
6016ae1ec8
feat(server): rdb loader big string loading in chunks (#4623)
1. rdb loader big string loading in chunks 
2. snapshot compression logic is disabled in case of big buffer

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-20 16:56:15 +02:00
Borys
a22daaf49d
refactor: simplify journal and restore streamer cancellation (#4549)
* refactor: simplify journal and restore streamer cancelation
2025-02-20 13:33:08 +02:00