2986 Commits

Author SHA1 Message Date
e713b8c692 remove lmpop unit tests
Also remove sentinel_test.py only for this branch.

Signed-off-by: adi_holden <adi@dragonflydb.io>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
v1.26.3
2025-02-09 11:24:14 +02:00
b16b5349e6 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 10:07:44 +02:00
cf1a8874a0 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-09 09:26:22 +02:00
a32bda3768 fix(search_family): Cherry pick commit "Support boolean and nullable types in indexes" to v1.26 (#4560)
fix(search_family): Support boolean and nullable types in indexes (#4314)

* fix(search_family): Support boolean and nullable types in indexes

fixes dragonflydb#4107, dragonflydb#4129



* refactor: address comments



---------

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2025-02-05 10:38:17 +01:00
2d67af8d8a 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:35:31 +02:00
096fde1723 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
v1.26.2
2025-01-30 15:33:58 +02:00
c056ccbd33 chore: update release build for arm (#4519)
fix: release build for arm
2025-01-30 15:32:10 +02:00
8c5da44fce 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-28 11:42:46 +02:00
b88748aa58 fix: crash for delconsumer during stream reading (#4513)
fix: crash for delconsumer during reading stream
2025-01-28 11:41:43 +02:00
c2b9541524 fix: ExtentTree use of invalidated iterator (#4416)
Fixes accessing and invalidated iterator within ExtendTree
v1.26.1
2025-01-12 15:23:21 +02:00
0b7c637a00 fix: reply_builder should properly serialize bulk strings endings. (#4441)
Due to a corner-case bug, reply builder could add \0\0 to the end of bulk strings, instead of
\r\n. The bug slipped our tests because redis-py parser most probably does not validate the ending
as long as everything else is consistent.

This PR:
1. Adds a test that catches the bug
2. Adds a debug check that verifies the destination pointer is consistent with the iovec being used.
3. Fixes the bug.

Fixes #4424
2025-01-12 14:03:00 +02:00
be467dc6e5 fix: ExternalAllocator::Free with large sizes (#4388)
ExternalAllocator allocates large sizes directly from the extent tree bypassing segment data structure.
Unfortunately, we forgot to align Free() the same way. This PR:

1. Make sure that we add back the allocated range to the extent tree in Free.
2. Rewrite and simplify ExtentTree::Add implementation.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-11 18:00:20 +02:00
8b173979d9 fix: properly clear tiered stashes upon expirations (#4395)
Fixes #4387

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-11 17:59:33 +02:00
c1c3f39782 fix: provide resp3 option to CapturingReplyBuilder (#4400) 2025-01-11 17:57:33 +02:00
9114255354 fix: show managed stuff on privileged port (#4433)
* fix: show managed stuff on privileged port

* chore: comments
2025-01-11 17:54:43 +02:00
33ddb7a018 fix: invalid iterator case in Qlist::Erase (#4414)
The problem was with reverse iterator that was not set properly
when the last node is deleted.

Also, move PushSentinel code into Push.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-01-11 17:51:54 +02:00
c5ef553ffc fix(search_family): Fix logging in ParseFieldWithAtSign (#4343)
Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
v1.26.0
2024-12-19 14:11:13 +00:00
79c4a1809b fix: Stack overflow in DFLYCLUSTER CONFIG (#4342)
fix: Stack overflow in `DFLYCLUSTER CONFIG`

It's fine to use the heap in such cases, latency doesn't matter.
2024-12-19 09:56:33 +02:00
e462fc0401 fix(server): use compression for non big values (#4331)
* fix server: use compression for non big values
---------

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-12-18 22:03:45 +02:00
904d21d666 fix: add content-type for metrics response (#4340)
chore: add content-type for metrics response.

Also, update the local stack to use prometheus 3.0
Finally, hex-escape arguments when logging an error for a command.

Fixes #4277

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-18 19:12:00 +00:00
3f68028c08 fix(pytest): call stop for all instances even if stop raise exception (#4339)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-12-18 18:03:37 +02:00
682a3f6b15 chore(helm-chart): update to v1.25.6 2024-12-18 14:00:03 +00:00
6a7931985b fix: cluster tests stability (#4338) 2024-12-18 13:43:45 +00:00
32d71071ae chore: Disable failing test (#4337) 2024-12-18 12:54:33 +00:00
e46717248d fix (regression tests): skip flaky test (#4336)
skip flaky test

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-12-18 10:35:47 +00:00
04e21c07da chore: fix wording around the dispatch fiber in dragonfly_connection (#4333)
Replace dispatch with async because we already have dispatch fiber in proactor code.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-18 09:22:55 +00:00
d0d720a375 test: skip test_network_disconnect_during_migration because it is uns… (#4334)
test: skip test_network_disconnect_during_migration because it is unstable
2024-12-18 08:38:03 +00:00
c22c9448b5 fix: do not check-fail in OpRestore (#4332)
fix: do not check-fail OpRestore

In some rare cases we reach inconsistent state inside OpRestore where a key already exists, though it should not.
In that case log the error instead of crashing the server. In addition, we update the existing entry to the latest restored value.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-18 09:53:03 +02:00
bf410b6e0b chore: add ability to track connections stuck at send (#4330)
* chore: add ability to track connections stuck at send

Add send_delay_seconds/send_delay_ms metrics.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Signed-off-by: Roman Gershman <romange@gmail.com>
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
2024-12-18 08:56:36 +02:00
15b293a7ec fix: crash during getting info about replication (#4328) 2024-12-18 08:44:24 +02:00
19164badf9 fix: potential OOM when first request sent in small bits (#4325)
Before: if socket data arrived in small bits, then CheckForHttpProto would grow
io_buf_ capacity exponentially with each iteration. For example, test_match_http test
easily causes OOM.

This PR ensures that there is always a buffer available - but it grows linearly with the input size.
Currently, the total input in CheckForHttpProto is limited to 1024.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-17 13:26:33 +02:00
0fe5e86a1a fix(test): seeder test remove check (#4320)
fix test: seeder test remove check

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-12-16 16:12:49 +02:00
dfd942d749 fix: Do not preempt on dispatcher fiber (#4323) 2024-12-16 15:39:35 +02:00
03516c2752 chore: factor out CompressorImpl into separate files (#4319)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-16 12:11:44 +00:00
8237d8fa81 refactor: remove serialization_max_chunk_size for cluster tests (#4316) 2024-12-16 13:42:56 +02:00
af04b558db fix: Remove hardcoded @assert_eventually 100 times retry (#4318)
This was a subtle and minor bug. Nice catch Borys!
2024-12-16 10:40:45 +00:00
53d6b64233 chore: factor out rdb_load utilities into separate files (#4315)
* chore: factor out rdb_load utilities into separate files

rdb_load.cc is huge and contains many auxillary classes.
This PR moves DecompressImpl and ErrorRdb code into detail/

It also fixes minor bugs around error conditions with de-compression:
a. Do not check-fail on invalid opcode and return error_code instead.
b. Print correctly LZ4 errors.

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

* chore: fixes

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-16 09:16:02 +00:00
027eff2ad3 server: report redis version 7.2.0 to support Sidekiq (#4286)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-12-16 11:06:08 +02:00
5e2d0d32b8 test: update logs and test for debug purpose (#4309)
test: update logs and test for devug purpose
2024-12-16 10:25:23 +02:00
84fa6bcb73 chore: improve parser state machine (#4313)
* chore: improve parser state machine

1. Separate argument type parsing from argument parsing itself.
2. Handle strings of length 1.

This is done in preparation of improving the parser contract -
so that when it returns INPUT_PENDING, it consumes the entire input.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-16 10:12:03 +02:00
9d6b2a133c fix(search_family): Fix FT.AGGREGATE output (#4311)
Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
2024-12-15 21:05:49 +04:00
027d76c13d fix: Protect BumpUp() from running in parallel to serialization (#4307)
* protect BumpUp() from running in parallel to serialization
2024-12-13 11:06:31 +02:00
55bc981a7e feat: add migration_finalization_timeout_ms flag (#4301) 2024-12-13 11:05:27 +02:00
53637790e8 fix: circular dependency in qlist (#4302)
* fix: circular dependency in qlist

fixes #4294

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

* chore: fixes

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

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-12-13 11:04:14 +02:00
f564513235 chore: update reflex version and fix its build on alpine (#4304) 2024-12-13 10:03:11 +02:00
b37287bf14 chore: test metrics for huge value serialization (#4262)
* fix seeder bugs
* add test
* add assertions for huge value metrics

Signed-off-by: kostas <kostas@dragonflydb.io>
2024-12-12 14:19:14 +02:00
f892d9b7fb fix: increase cluster migration default timeout (#4293) 2024-12-11 14:39:41 +00:00
76f79f0e0b fix(search_family): Remove the output of extra fields in the FT.AGGREGATE command (#4231)
* fix(search_family): Remove the output of extra fields in the FT.AGGREGATE command

fixes dragonflydb#4230

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>
2024-12-11 11:21:20 +00:00
1e3d9de0f6 chore(helm-chart): update to v1.25.5 2024-12-11 09:57:16 +00:00
e63613f5ed fix: mismatch new-delete in unit test (#4288) 2024-12-11 08:30:58 +00:00