Commit graph

3097 commits

Author SHA1 Message Date
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
adiholden
d88bdb8bc3
fix(test): fix rdb random fail on OOM (#4509)
fix rdb test random fail on OOM

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-01-27 11:59:04 +02:00
Kostas Kyrimis
e5da019419
chore: split epoll/uring reg test flows (#4512)
Signed-off-by: kostas <kostas@dragonflydb.io>
2025-01-27 11:14:07 +02:00
adiholden
b4ef0a06e2
fix cluster: migration crash fix (#4508)
* fix cluster: migration crash fix

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-01-27 10:39:11 +02:00
Shahar Mike
3fdd9877f4
fix: Do not bump elements during RDB load (#4507)
fix: Do not bump elements during RDB load #4507

The Issue

Before this PR, when loading an RDB, we modified fetched_items_ as part of the loading process. This has little effect, unless the next issued command calls FLUSHALL / FLUSHDB (could happen in DFLY LOAD, REPLICAOF or just calling FLUSHALL directly). In such a case, a CHECK() fails.

The Fix

While load is not run as a command (in a transaction), it still uses APIs that assume that they are called in the context of a command. As such, it indirectly used DbSlice::FindInternal(), which bumps elements when called.

This PR adds another sub-mode to DbSlice, named load_in_progress_. When true, we treat DbSlice as if it is not in cache mode, ignoring cache_mode_.

BTW this PR also renames caching_mode_ to cache_mode_ as we generally use the term cache mode and not caching mode, including in the --cache_mode flag.

Fixes #4497
2025-01-26 23:18:28 +02:00
Roman Gershman
bafb427a09
fix: rpm package setup (#4506)
Also, fix the deadlock problem on shutdown on Oracle Linux 5.15
Fixes #4505

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-26 12:40:33 +02:00
Roman Gershman
904775cfe6
chore: new docker build pipeline (#4503)
Our previous weekly pipeline used qemu, was very slow and over-complicated.
This one uses matrix with proper parallelization and the latest arm64 github runners.

now it takes less than 30 minutes to build everything.
lets make it daily.
2025-01-26 12:03:42 +02:00
Roman Gershman
23af41ca07
fix: several bugs (#4500)
1. Fixes #4466 (we did not check validity of the scan cursor)
   We fix it by quietly returning "end of scan" result, i.e. no error are returned.
2. Add 34b1048274c8e50a0cc587a3ed9c383a82bb78c5 sha to the lua_undeclared_keys_shas list.
3. Pull helio that fixes bugs with WaitQueue and IdleTasks: 2ab4412b78
2025-01-24 13:53:09 +02:00
adiholden
69ef9979f0
skip test_migration_one_after_another on epoll (#4499)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-01-22 17:06:41 +00:00
adiholden
d6adedb066
fix(cluster): crash in cluster migration (#4495)
fix crash in cluster migration

Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-01-22 14:26:53 +02:00
Roman Gershman
451da72c41
chore: improve test_timeout robustness (#4494)
1. use assert_eventually
2. add more logs
3. unrelated - add a stats event to track timeout shutdowns.
2025-01-22 12:24:29 +00:00
Kostas Kyrimis
4a2f2e3d04
chore: add sanitizers to ci workflow (#4462)
* chore: add sanitizers to ci workflow
---------

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-01-22 12:00:10 +02:00
Kostas Kyrimis
d44eec2285
fix: test_acl_cat_commands_multi_exec_squash (#4492)
* add sleep in test

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-01-22 11:15:25 +02:00
Roman Gershman
4b8fa90a67
feat: add 'testing_time' limit option to dfly_bench (#4487)
* feat: add 'testing_time' limit option to dfly_bench
---------

Signed-off-by: Roman Gershman <romange@gmail.com>
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
2025-01-22 10:26:22 +02:00
Roman Gershman
20bc3188fe
feat: implement connection timeout functionality (#4407)
* feat: implement connection timeout functionality

`timeout` argument shuts down idle connections after the specified time.

Fixes #1677
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-21 13:46:57 +02:00
adiholden
986ef7c0e2
fix (stream): XRANGE incorrectly interprets the end parameter (#4443)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2025-01-20 21:07:49 +02:00
Stepan Bagritsevich
5d3e3146d3
feat(json_family): Add json_nesting_depth_limit flag (#4444)
* feat: Add json_nesting_depth_limit flag

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-01-20 16:49:04 +00:00
Roman Gershman
99c4ab8abe
feat: add support for noreply option (#4485)
feat: add support for noreply and greeat options

noreply option is applicable for memcached.
great option ensure the tcp connection is indeed established before proceeding with loadtest.
2025-01-20 13:59:47 +00:00
Borys
010166525e
feat: allow finish and start migration in the same config (#4486) 2025-01-20 13:52:38 +00:00
Mykhailo Faraponov
91435bc6af
Fix typo in outgoing_slot_migration.cc (#4484)
Signed-off-by: Mykhailo Faraponov <11322032+moredure@users.noreply.github.com>
2025-01-20 12:38:02 +00:00
Roman Gershman
7d0530547b
chore: remove pubsub semantics from Connection::WeakRef (#4483)
Make it generic and move pubsub related logic into channel_store.
2025-01-20 12:32:17 +00:00
Kostas Kyrimis
85cc443448
chore: run regression tests with epoll (#4426)
* chore: run regression tests with epoll

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-01-20 14:18:21 +02:00
Roman Gershman
4acafa3d47
chore: OpManagerTest fixes (#4480) 2025-01-20 11:38:26 +00:00