mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-13 03:15:44 +02:00
feat(transaction): Idempotent callbacks (immediate runs) (#2453)
This commit generalizes the machanism of running transaction callbacks during scheduling, removing the need for specialized ScheduleUniqueShard/RunQuickie. Instead, transactions can be run now during ScheduleInShard - called "immediate" runs - if the transaction is concluding and either only a single shard is active or the operation can be safely repeated if scheduling failed (idempotent commands, like MGET). Updates transaction stats to mirror the new changes more closely. --------- Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
84d451fbed
commit
fbc55bb82d
12 changed files with 150 additions and 285 deletions
|
@ -671,7 +671,7 @@ TEST_F(MultiTest, ExecGlobalFallback) {
|
|||
Run({"set", "a", "1"}); // won't run ooo, because it became part of global
|
||||
Run({"move", "a", "1"});
|
||||
Run({"exec"});
|
||||
EXPECT_EQ(1, GetMetrics().coordinator_stats.tx_type_cnt[ServerState::GLOBAL]);
|
||||
EXPECT_EQ(1, GetMetrics().coordinator_stats.tx_global_cnt);
|
||||
|
||||
ClearMetrics();
|
||||
|
||||
|
@ -683,7 +683,7 @@ TEST_F(MultiTest, ExecGlobalFallback) {
|
|||
Run({"exec"});
|
||||
|
||||
auto stats = GetMetrics().coordinator_stats;
|
||||
EXPECT_EQ(1, stats.tx_type_cnt[ServerState::QUICK] + stats.tx_type_cnt[ServerState::INLINE]);
|
||||
EXPECT_EQ(1, stats.tx_normal_cnt); // move is global
|
||||
}
|
||||
|
||||
TEST_F(MultiTest, ScriptFlagsCommand) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue