Commit graph

25 commits

Author SHA1 Message Date
Roman Gershman
23ef7b72e5
chore: track squash reply allocation as early as they are created
Before - we used a global atomic var current_reply_size that was constantly updated by all threads
when reply buffers grew for squashing.

Now, we use per thread atomic variables that track reply buffer size for the I/O thread that issues squashing.
The shard threads contend less because they update multiple atomic variables. Moreover,
now we can adjust IsPipelineBufferOverLimit to take into account squashing_current_reply_size as well.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-05-05 14:43:09 +03:00
Roman Gershman
41508f241a
chore: remove global current_reply_size
Before - we used a global atomic var current_reply_size that was constantly updated by all threads
when reply buffers grew for squashing.

Now, we use per thread variables. The disadvantage - the metric is less precise because we first allocate buffers
in a shard thread but update the thread local metrics in the coordinator threads.
I think the tradeoff is fair and the fact that the metric is updated with delay is not crucial.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-05-05 12:03:49 +03:00
Roman Gershman
10cd22375e
chore: more performance improvements around MGET and pipelining (#5022)
1. Remove one vector (affects allocation and data locality) in squashing.
2. stop deduplicating MGET keys by default, but keep it as a run-time flag.

Also, finally fix TieredStorageTest.FlushAll test.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2025-04-30 08:15:55 +03: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
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
Kostas Kyrimis
fb7a1facc8
fix: lsn check failure (#4881)
* rename StaticSeeder to DebugPopulateSeeder to show intent
* add a DCHECK in debug populate that triggers if there is a registered replica that hasn't reached stable sync
* small cleanup

Signed-off-by: kostas <kostas@dragonflydb.io>
2025-04-07 07:48:01 +00:00
Borys
0e116b1535
fix: slot calculation during transaction squashing (#4460) 2025-01-15 11:43:52 +00:00
Borys
933c9f0b1c
refactor: remove transaction lib on cluster code dependency (#4417) 2025-01-08 09:38:13 +00:00
Borys
f663f8e841
fix: provide resp3 option to CapturingReplyBuilder (#4400) 2025-01-05 14:16:02 +02:00
Borys
e16ef838e4
feat: add INFO memory section for squashing replies memory consuming (#4147)
* feat: add INFO memory section for squashing replies memory consuming

* refactor: address comments
2024-11-18 21:16:41 +02:00
adiholden
db67b35f8e
fix server: fix stats of pipeline squashed commands (#4132)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-11-14 20:57:05 +02:00
Roman Gershman
6f6897cef1
chore: pass RedisReplyBuilder explicitly from dragonfly connection (#4009)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-10-29 14:52:09 +02:00
adiholden
ccada875e0
feat(server): master stop sending exec opcode to replica (#3289)
* feat server: master stop sending exec opcode to replica

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-07-09 14:48:31 +03:00
Borys
2230397a12
refactor: add cluster namespace (#2948)
* refactor: add cluster namespace, remove extra includes
2024-04-22 21:45:43 +03:00
Roman Gershman
7e0536fd4c
chore: remove core/fibers (#2723)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-14 12:02:33 +00:00
Shahar Mike
4874da8b5b
feat(cluster): Add RestoreStreamer. (#2390)
* feat(cluster): Add `RestoreStreamer`.

`RestoreStreamer`, like `JournalStreamer`, streams journal changes to a
sink. However, in addition, it traverses the DB like `RdbSerializer` and
sends existing entries as `RESTORE` commands.

Adding it required a bit of plumbing to get all journal changes to be
slot-aware.

In a follow-up PR I will remove the now unneeded `SerializerBase`.

* Fix build

* Fix bug

* Remove unimplemented function

* Iterate DB, drop support for db1+

* Send FULL-SYNC-CUT
2024-01-10 15:10:21 +02:00
Roy Jacobson
c3a2da559e
feat(server): Implement CLIENT PAUSE (#1875)
* feat(server): Implement CLIENT PAUSE

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-11-15 08:56:49 +02:00
Vladislav
4b387cebe2
fix(server): Exclude eval from pipeline squashing (#2027)
* fix(server): Exclude eval from pipeline squashing

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-10-16 17:48:42 +03:00
Vladislav
c65b9cf63d
fix: Fix squashing, pytest arg formatting (#1712)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-18 09:28:19 +03:00
Vladislav
16e512c60d
feat: Refactor command verification before execution (#1652)
* feat: Refactor verifications

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-08 12:36:31 +03:00
Vladislav
844fe57dec
feat: Remove batch locks from non-atomic squashing (#1613)
feat: Remove batch locks from non-atomic squashing

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-02 09:16:47 +03:00
Vladislav
74a1454409
Collect errors from async lua calls (#1092)
Error collection from async calls
2023-04-22 09:02:22 +03:00
Roy Jacobson
efe18ef19d
fix: use fibers.h alias for SimpleChannel (#1059) 2023-04-09 18:08:07 +03:00
Vladislav
c29db83b7e
feat(server): Squashed exec (#1025)
Introduces squashed executor that allows squashing single-shard commands within multi transactions
2023-04-08 23:34:33 +03:00