Commit graph

3119 commits

Author SHA1 Message Date
Roman Gershman
6870309033
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 19:17:29 +02:00
adiholden
429ac6219b
fix(cluster) : moved error port number on migration finish (#4776)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-17 19:17:01 +02:00
Roman Gershman
0e56a09f70
fix: do not crash upon inconsistent expire iterator (#4658)
Fixes #4656

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-03-09 10:30:37 +02:00
Lewis
21b19e9abb
fix(metrics): add corresponding comments to command metrics (#4674)
---------

Signed-off-by: Lewis <lewis@ourzora.com>
2025-03-09 10:28:10 +02:00
adiholden
4f9103073b
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-09 10:27:39 +02:00
Borys
cf47d684a5
feat: allow cluster READONLY command (#4727)
* feat: allow cluster READONLY command
2025-03-09 10:25:21 +02:00
adiholden
86e12013f0
server: disable single shard tx optimization on scheduling (#4647)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-03-09 10:24:14 +02:00
Kostas Kyrimis
9e52438862
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-09 09:30:54 +02:00
Roman Gershman
e6fabfef6f
fix: debian path in dragonfly.service (#4594)
Split the rpm service file from debian.
Fixes #4593

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-12 09:21:48 +02:00
Borys
a371609e83
fix: huge TTL in RESTORE cmd is rounded to kMaxExpireDeadlineMs (#4589) 2025-02-11 14:11:38 +02:00
Borys
a56b129f69
test: add ClusterEvalCrossslot (#4587) 2025-02-10 16:16:21 +00:00
Roman Gershman
8eb5e24147
fix: incorrect passing of db_index in EVAL transactions (#4586)
Before this PR, EVAL transactions would always use db_index=0
leading to inconsistent interactions with other commands on non-zero
databases. Specifically the test in the PR would deadlock.

This PR fixes the issue. Also fixes #4583

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-10 17:26:16 +02:00
Borys
d0087aaa6a
fix: migration finalization process (#4576)
* fix: migration finalization process
2025-02-10 15:43:32 +02:00
Volodymyr Yavdoshenko
386ab3902b
fix: ascii logo was added (#4524)
ascii logo was added
2025-02-10 09:29:28 +02:00
Roman Gershman
13313507bf
chore: minor simplification around WaitWatch (#4580)
1. Rename FinalizeWatched to RemovedWatched.
2. Simplify passing of WatchedKeys - instead of passing a callback
   we pass either a single value or signal that all the shard
   keys should be used. Less generic but more explicit.
3. Reverse the result from RunInShard() function - to improve readability.

All in all it should not have any functional changes besides logging.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-09 20:59:28 +02:00
adiholden
1e15e55cee
server: enable big value serialization by default (#4581)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-09 18:20:23 +02:00
romange
df48913056 chore(helm-chart): update to v1.26.3 2025-02-09 10:59:43 +00:00
Roman Gershman
6f8a52ecef
fix: a rare deadlock with blmove and multi-db (#4568)
The bug requires lots of conditions in order to reproduce:
1. blocking operations on multiple databases
2. use of lua scripts that wake blocking transactions

The bug was discovered due to a deadlock in BLMOVE but could also manifest with other commands that would
"disappear" causing local starvation effects on the connections sending them.
With BLMOVE it causes a global deadlock in the transaction queue in dragonfly.

The fix is actually deleting a few lines of code introduced by #3260 from 6 months ago,
so it is actually a long lived regression.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-09 09:58:24 +02:00
Volodymyr Yavdoshenko
9262ec9b0f
docs: the broken link was fixed (#4579)
broken link was fixed
2025-02-07 21:10:53 +02:00
Roman Gershman
acde373709
fix: a regex bug with escaping inside of character classes (#4575)
Also delete the broken docker weekly flow.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-07 10:42:45 +00:00
Roman Gershman
b0b9a72dbd
feat: introduce more options for traffic logger (#4571)
1. Provide clear usage instructions
2. Add "pace" option, which when false, sends traffic as quickly as possible (default true).
3. Add skip option that sometimes can be useful to remove unneeded noise

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-07 11:10:13 +02:00
adiholden
5337711976
fix server: fix deadlock blmove does not conclude on error (#4561)
* fix deadlock: fix blmove does not conclude on error

---------

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-02-07 11:09:29 +02:00
Kostas Kyrimis
af5a21bdac
chore: pull helio epoll fix and tests (#4559)
* pull helio
* re-add epoll test_migration_one_after_another

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-06 12:25:54 +02:00
Borys
33584b9e96
refactor: rename Context into ExecutionState (#4562) 2025-02-06 08:47:20 +02:00
Stepan Bagritsevich
4ba1142cb3
fix(stream_family): Fix journaling in the XADD and XTRIM commands (#4448)
* fix(stream_family): Fix journaling in the XADD and XTRIM commands

fixes dragonflydb#4202

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

* fix(replication_test): Fix a typo

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

* feat(replication_test): Add test_stream_approximate_trimming test

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

* refactor: address comments

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

* refactor: address comments 2

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

* fix(stream_family): Fix stream id journaling in the XADD command

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

---------

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-02-05 14:43:26 +00:00
Shahar Mike
47a1305ea1
Fix BullMQ tests workflow in GitHub actions (#4565)
Squash

Co-authored-by: shahar <shahar@dragonflydb.io>
2025-02-05 13:56:52 +00:00
Shahar Mike
f8667235db
chore: Add FakeRedis capture/compare to more cluster tests and seed during migration (#4542)
* chore: Add FakeRedis capture/compare to more cluster tests

Note that we can't add such a test to `test_cluster_native_client`
because we don't do a migration there, just re-assign slots, meaning
that data is lost (by desgin?)

Fixes #4429

* Seed during migrations

* Add TODO
2025-02-05 14:34:42 +02:00
Roman Gershman
6d1c22b64c
chore: GlobMatcher uses now reflex::Matcher regex engine (#4528)
Also consolidate benchmarking low level routines undeer dfly_core_test

```
BM_ParseFastFloat                   707 ns          707 ns      4005656
BM_ParseDoubleAbsl                 1460 ns         1460 ns      1927158
BM_MatchGlob/1000                   121 ns          121 ns     23701780
BM_MatchGlob/10000                  512 ns          512 ns      5481405
BM_MatchFindSubstr/1000             123 ns          123 ns     31114255
BM_MatchFindSubstr/10000           1126 ns         1126 ns      2522019
BM_MatchReflexFind/1000             118 ns          118 ns     22442417
BM_MatchReflexFind/10000            512 ns          512 ns      5414329
BM_MatchReflexFindStar/1000         106 ns          106 ns     26276727
BM_MatchReflexFindStar/10000        717 ns          717 ns      3719605
BM_MatchStd/1000                  19782 ns        19779 ns       128020
BM_MatchStd/10000                199809 ns       199781 ns        13837
BM_MatchRedisGlob/1000             1601 ns         1601 ns      1754635
BM_MatchRedisGlob/10000           16494 ns        16493 ns       171585
BM_MatchRe2/1000                   1039 ns         1039 ns      2709486
BM_MatchRe2/10000                 10041 ns        10040 ns       281296
```

What's curious is that now matching `*foobar*` on string is faster than
searching for 'foobar` using string::find() (BM_MatchGlob vs BM_MatchFindSubstr)

Improvement vs Redis is 10-30 times faster (BM_MatchRedisGlob vs BM_MatchGlob).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-05 10:29:51 +02:00
Kostas Kyrimis
a40b5063e2
fix: consume parser error on dfly load (#4556)
* fix dcheck crash on dfly load
* fix dfly load with more than required arguments

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-05 10:11:04 +02:00
Roman Gershman
dc3a91e083
fix: Bug GEQ range query bug (#4557)
The bug was caused by incorrect handling of corner cases,
when a path that should lead to an item was wrongfully cleared, which lead
to empty results for SortedMap::GetRange query.

This PR:
1. fixes the wrong code in bptree_set.h.
2. Adds unit tests for both bptree_set_test and sorted_map_test.

Related to https://github.com/mastodon/mastodon/issues/33805

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-04 17:06:08 +02:00
Borys
6c68519f02
fix: test_snapshoting_during_migration (#4555) 2025-02-04 13:56:24 +00:00
Kostas Kyrimis
abe3306abd
chore: remove clang install step from ci workflow (#4550)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-02-04 15:00:07 +02:00
Roman Gershman
80e4012ab1
chore: Add benchmarks of qlist compression paths (#4543)
1. Add testdata, move the existing test data to zstd-compressed format.
2. Add benchmarks in qlist_test that add lots of records, forcing compression of inner noded,
   or read compressed list checking the decompression.

Currently qlist uses valkey compression algorithm.

On my machine:
1. (valkey) Compression is 5 times slower than no compression.
2. Decompression is 37 times slower.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-02 19:25:39 +00:00
Roman Gershman
bff9cf6923
chore: move QList::Node definition into dragonfly codebase (#4547)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-02 19:25:01 +00:00
Roman Gershman
8c937ebf37
chore: clean up of deprecated flags (#4545)
Also fix sentinel test by using a precise redis-server version.
Finally, add pytest warnings filter to reduce noise

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-02-02 20:03:23 +02:00
Roman Gershman
9d303f8abe
chore: refactoring around glob matching (#4540)
1. Make GlobMatcher non-copyable. It's something I will need in the next PR.
2. Move low-level benchmarking testing code into dfly_core_test.

No functional changes.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-31 09:54:37 +02:00
romange
89db7ebf9b chore(helm-chart): update to v1.26.2 2025-01-30 21:05:36 +00:00
Borys
c95ad19830
chore: update release build for arm (#4519)
fix: release build for arm
2025-01-30 12:56:47 +00:00
Kostas Kyrimis
c05d1cafc8
chore(ci): report proactor kind on reg test failure (#4531)
* include epoll or iouring on notification failures

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-01-30 14:24:32 +02:00
Stepan Bagritsevich
83569aca28
fix(search_family): Add options test for the FT.SEARCH command (#4478)
Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-01-30 09:43:01 +00:00
Roman Gershman
fc94b2c265
chore: add more logs to the op_manager code (#4527)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-29 19:08:41 +02:00
Shahar Mike
ffce1cb796
chore: Add Lua force atomicity flag (#4523)
* chore: Add Lua force atomicity flag

We accidentally instructed Sidekiq to add `disable-atomicity` to their
script, despite them needing to run atomically.

This hack-ish PR adds a `--lua_force_atomicity_shas` flag to allow
specifying which SHAs are forced to run in an atomic fashion, even if
they are marked as non-atomic.

Fixes #4522

* fix build on clang
2025-01-29 16:35:39 +02:00
Roman Gershman
bb9819464f
chore: introduce GlobMatcher (#4521)
Right now it's just a wrapper around stringmatchlen, so no functional changes are expected.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-29 10:58:17 +02:00
Roman Gershman
f2309f4e7b
chore: add reflex matcher to the benchmarks (#4520)
Add a test covering stringmatchlen.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-28 15:43:41 +00:00
Volodymyr Yavdoshenko
efb7861cee
fix: LMPOP implementation was added (#4504) 2025-01-28 08:52:38 +00:00
Roman Gershman
44506ad2a9
chore: remove unused code (#4516)
Move PrimeBumpPolicy definition to cc file.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-28 10:41:11 +02:00
dependabot[bot]
d945b831db
chore(deps): bump github/codeql-action from 3.28.0 to 3.28.5 in the actions group across 1 directory (#4514)
chore(deps): bump github/codeql-action

Bumps the actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.0 to 3.28.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](48ab28a6f5...f6091c0113)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 08:57:24 +02:00
Borys
e434f62336
fix: crash for delconsumer during stream reading (#4513)
fix: crash for delconsumer during reading stream
2025-01-27 18:32:53 +02:00
Roman Gershman
2d85f59a74
chore: add benchmarking of ScanOpts::Matches (#4511)
Also, improve robustness of StickyEviction that was failing for me.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-27 18:14:55 +02:00
Kostas Kyrimis
fbd785cbc7
chore: add defrag for StringSet (#4308)
* add defrag logic for StringSet
* add test
2025-01-27 12:53:38 +02:00