Commit graph

3354 commits

Author SHA1 Message Date
kostas
97c1b16c26
fix typo 2025-04-28 16:31:09 +03:00
kostas
0bc2ea602d
chore: reproduce MultiLeavesTxQueue fails on multi-shard
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-04-28 16:15:22 +03:00
Borys
70be62c6a1
chore: add DCHECK to easier tests debugging (#5018) 2025-04-28 11:15:05 +00:00
Volodymyr Yavdoshenko
2128eb31c9
fix: HNSW schema deleting document crash (#4987)
fixed: https://github.com/dragonflydb/dragonfly/issues/4979
2025-04-28 11:01:04 +00:00
Borys
5ea3070abf
refactor: update contributing doc (#5016) 2025-04-28 13:20:44 +03:00
mkaruza
98fb8fb38f
fix(glob): Correctly match longer strings with '*' or '**' pattern (#5001)
* fix(glob): Correctly match longer strings with '*' or '**' pattern

If string is longer than 16 chars we are using reflex library for
matching. When used pattern is '*' or '**' we are going to remove
trailing and leading star and have empty pattern. We should, in this,
edge case set manually star pattern.

Fixes #4948

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

* Core matching test

---------

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-04-28 12:54:54 +03:00
Roman Gershman
23e6db900d
fix: regtest failures (#5013)
1. Fix a crash bug in RESETSTAT when number of shards is less than number of threads.
2. Tune regtests parameters for pipelining tests to pass.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-28 12:49:44 +03:00
Volodymyr Yavdoshenko
aa7e8abcb6
fix: RENAME in cluster mode crash (#4995)
fixed: https://github.com/dragonflydb/dragonfly/issues/4993
2025-04-28 08:45:05 +00:00
Roman Gershman
0f415acb81
chore: StoredCmd to support both owned and external arguments (#5010)
Before: StoredCmd always copied the backing buffer of the commands.
this of course sub-optimal if the bucking buffer exists during the life-time
of StoredCmd. This is exactly the case in `Service::DispatchManyCommands`.

This PR:
1. Adds support for both owned and non-owned arguments.
2. Improves the interfaces around StoredCmd and removes some code duplication.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-28 10:55:14 +03:00
Roman Gershman
d7a7591a46
chore: clean ups around command squasher (#5011)
1. Eliminate replies reverse call - will allow to unite replies and cmd vectors into one.
2. Introduce SwitchTxCmd function to avoid code duplication.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-28 10:44:42 +03:00
Roman Gershman
d37318711c
chore: fix some clang-tidy warnings (#5009) 2025-04-28 09:57:19 +03:00
Volodymyr Yavdoshenko
59a347df99
fix: bitops_family crash fixed (#4989)
fixed: https://github.com/dragonflydb/dragonfly/issues/4988
2025-04-28 09:41:46 +03:00
Roman Gershman
6d30baa20b
chore: Pipelining fixes (#4994)
Fixes #4998.
1. Reduces agressive yielding when reading multiple requests since it humpers pipeline efficiency.
   Now we yield consistently based on cpu time spend since the last resume point (via flag with sane defaults).
2. Increases socket read buffer size effectively allowing processing more requests in bulk.

`./dragonfly  --cluster_mode=emulated`
latencies (usec) for pipeline sizes 80-199:
p50: 1887, p75: 2367, p90: 2897, p99: 6266

`./dragonfly  --cluster_mode=emulated --experimental_cluster_shard_by_slot`
latencies (usec) for pipeline sizes 80-199:
p50: 813, p75: 976, p90: 1216, p99: 3528

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-27 20:48:02 +03:00
Roman Gershman
ff7d9b79c6
fix: potential crash with multi-sharded pfmerge (#5008)
Fixes #5004

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-27 14:12:55 +03:00
Roman Gershman
d5c375235f
feat: allow sharding by cluster slot id (#5006)
This is relevant only for cluster-enabled configurations.
Also, inline the cluster config getter functions, as they are on critical path for 100% of requests.

Finally, skip a test that triggers a check-fail bug filed in #5004

Fixes #5005

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-26 22:45:17 +03:00
Kostas Kyrimis
71dd189ebd
chore: split unit test steps in ci workflow (#5002)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-04-25 20:14:04 +03:00
Phuc-Thanh Nguyen
473e002c84
fix: potential vulnerable cloned functions (#4996)
Fix potential vulnerable cloned functions: Security: update Lua struct package for security.
2025-04-25 19:15:42 +03:00
Xiaochuan Ye
a02af96457
refactor(debug-cmd): migrate ParsePopulateArgs to CmdArgParser (#4838)
* refactor(debug-cmd): migrate ParsePopulateArgs to CmdArgParser

Signed-off-by: yexiaochuan <tap91624@gmail.com>
2025-04-25 11:16:14 +03:00
Tarun Pothulapati
7d0530656f
feat(tools/replay): Add pipeline latency distribution data (#4990)
feat(replay): add latency distributions

* also add avg latency
* also include pipeline range
* display both at the end
2025-04-24 19:23:43 +03:00
Kostas Kyrimis
680722d8ff
chore: time sensitive throttle for scan command (#4954)
The issue is that Scan has high latency (in seconds) when keys are large and there are no matches. Iterating 10k buckets and string matching each of the keys is potentially an expensive operation that depends on the keyspace and the number of actual matches.

* replace heuristic in scan command to throttle based on time

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-04-24 09:50:32 +03:00
Daniel M
c06e154d43
Fix test hypothesis (#4927)
* fix:test-hypothesis

---------

Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2025-04-23 18:11:37 +03:00
Abhijat Malviya
30a98c4fac
chore(hset_family): Support resp3 format for hrandfield (#4978)
* chore(hset_family): Support resp3 format for hrandfield

Return nested arrays if hrandfield is used with values.

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-04-23 18:22:02 +05:30
Volodymyr Yavdoshenko
9e3fb79225
feat: availability_zone flag support was added (#4976)
fixed: https://github.com/dragonflydb/dragonfly/issues/4959
2025-04-22 12:40:08 +00:00
Abhijat Malviya
ff8bf7817a
chore(acl_family): Move some variables outside loop (#4975)
Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-04-22 15:18:52 +05:30
Abhijat Malviya
1b0aa56028
Add workflow to run mastodon ruby test suite (#4946)
initial version of mastodon test

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-04-22 13:08:07 +05:30
Volodymyr Yavdoshenko
69a37bf946
fix: FT.SEARCH KNN crash fixed (#4973) 2025-04-22 10:26:58 +03:00
romange
38687526ad chore(helm-chart): update to v1.29.0 2025-04-21 08:26:09 +00:00
Abhijat Malviya
0fafa21722
feat(server): Add support for command aliasing (#4932)
Add support for command aliasing using command_alias flag

Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
2025-04-21 07:59:04 +00:00
Roman Gershman
7ffe812967
feat(dfly_bench): allow regulated throughput in 3 modes (#4962)
* feat(dfly_bench): allow regulated throughput in 3 modes

1. Coordinated omission - with --qps=0, each request is sent and then we wait for the response and so on.
   For pipeline mode, k requests are sent and then we wait for them to return to send another k
2. qps > 0: we schedule sending requests at frequency "qps" per connection but if pending requests count crosses a limit
   we slow down by throttling request sending. This mode enables gentle uncoordinated omission, where the schedule
   converges to the real throughput capacity of the backend (if it's slower than the target throughput).
3. qps < 0, similar as (2) but does not adjust its scheduling and may overload the server
   if target QPS is too high.

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

* chore: change pipelining and coordinated omission logic

Before that the uncoordinated omission only worked without pipelining.
Now, with pipelining mode with send a burst of P requests and then:
a) For coordinated omission - wait for all of them to complete before proceeding
   further
b) For non-coordinated omission - we sleep to pace our single connection throughput as
   defined by the qps setting.

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

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-21 09:56:33 +03:00
adiholden
5147fa9595
feat (server): add flag max_squashed_cmd_num (#4964)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-04-20 21:38:54 +03:00
Borys
707d7f0265
test: add check for removing readonly replica (#4963) 2025-04-20 12:51:56 +03:00
Roman Gershman
2ca5bf1192
chore: pass max_squash_size for MultiCommandSquasher via option (#4960)
No functionality was changed. Also fix a build error on macos.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-20 12:14:23 +03:00
Volodymyr Yavdoshenko
a42a17f868
feat: wildcard pattern added for fields to find all non-null values (#4941)
fixed: https://github.com/dragonflydb/dragonfly/issues/4937
2025-04-18 12:47:00 +03:00
Volodymyr Yavdoshenko
954e9404c3
fix: field without @ sign in the FT.AGGREGATE command error message fixed (#4955)
fixed: https://github.com/dragonflydb/dragonfly/issues/4935
2025-04-18 10:57:39 +03:00
Roman Gershman
220f20bac6
feat: expose table capacities instead of number of buckets (#4956)
Also, add a local dashboard demonstrating prime table load per db.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-18 10:30:04 +03:00
romange
420991d4d0 chore(helm-chart): update to v1.28.2 2025-04-17 11:49:58 +00:00
Stepan Bagritsevich
c81d99037d
fix(search_family): Fix SORTBY option in FT.SEARCH for non-sortable fields and KNN search (#4942)
* fix(search_family): Fix SORTBY option in FT.SEARCH for non-sortable fields and KNN search

fixes dragonflydb#4939, dragonflydb#4934

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

* fix compilation error

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

---------

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2025-04-17 13:43:25 +02:00
Kostas Kyrimis
36e6d4527c
chore: add metrics for heartbeat evictions (#4952)
* evict in heartbeat if expire table is not empty
* add metrics around heartbeat evictions (total evictions and total evicted bytes)

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-04-17 13:25:40 +03:00
mkaruza
770a926b3f
fix(set_family): Transfer TTL flag from DenseLink object in delete (#4947)
fix(set_family): Transfer TTL flag from link to object in delete

When extracting DensePtr from LinkObject we need to transfer TTL flag
before this DensePtr is assigned.

Fixes #3915

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-04-17 10:55:04 +02:00
dureamPark
eba8340ad1
docs(readme): fix typo in README.ko-KR.md (#4949)
Signed-off-by: dureamPark <105711012+dureamPark@users.noreply.github.com>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2025-04-17 06:28:57 +00:00
Roman Gershman
95147fbb59
fix: broken gha cache (#4951)
* fix: broken gha cache

Also fix some clang warnings.

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

* chore: comments

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-17 08:30:58 +03:00
Roman Gershman
eb80d576d5
chore: Make snapshotting more responsive (#4910)
* chore: Make snapshotting more responsive

This should improve situation around #4787 -
maybe not solve it completely but improve it significantly.

On my tests when doing snapshotting under read traffic with master
(memtier_benchmark --ratio 0:1 -d 256  --test-time=400  --distinct-client-seed --key-maximum=2000000 -c 5 -t 2 --pipeline=3)
I got drop from 250K qps to 8K qps during the full sync phase.

With this PR, the throughput went up to 70-80K qps.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-16 07:48:23 +03:00
adiholden
b86b692461
server(bug): fix json mget crash on invalid path (#4940)
* server: fix json mget crash on invalid path

---------

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-04-15 21:56:10 +03:00
Volodymyr Yavdoshenko
d21166211d
fix: ZRANGE with LIMIT parameters crash fixed (#4944)
fixed: https://github.com/dragonflydb/dragonfly/issues/4943
2025-04-15 20:42:26 +03:00
mkaruza
9505d21047
fix(connection): Close MONITOR connection if pipeline overflows (#4889)
Close MONITOR connection if we overflow pipeline limits. It can happen
that MONITOR connection dispatches messages slower than they are received
causing memory to go out of bounds (and can result in process crash).

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-04-15 08:26:48 +02:00
Borys
5fc585b272
fix: test_migration_timeout_on_sync (#4933) 2025-04-14 20:59:42 +03:00
Volodymyr Yavdoshenko
eeb27f3569
fix: prefix search with added synonyms fixed (#4930)
fixed: https://github.com/dragonflydb/dragonfly/issues/4923
2025-04-14 19:04:05 +03:00
Volodymyr Yavdoshenko
9263fc8e92
fix: Dropping stale connections updated (#4909)
fixed: https://github.com/dragonflydb/dragonfly/issues/4893
2025-04-14 17:28:32 +03:00
mkaruza
ea17fc9893
fix(set_family): Update object time during SET FIELDEXPIRE (#4903)
StringSet object doesn't update time when FIELDEXPIRE is called. It will
use base time when object is created. Update object time when we want to
expire field in SET object.

Fixes #4894

Signed-off-by: mkaruza <mario@dragonflydb.io>
2025-04-14 13:14:40 +02:00
Stepan Bagritsevich
39a00806c9
fix(stream_family): Fix memory tracking for the STREAMs. SECOND PR (#4781)
* fix(stream_family): Fix memory tracking for the STREAMs

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-04-14 13:07:17 +02:00