mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix(server): handle no-key-transactional commands in multi/exec (#2279)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
7ca07a498f
commit
e273f7a2b8
2 changed files with 12 additions and 0 deletions
|
@ -678,6 +678,12 @@ optional<Transaction::MultiMode> DeduceExecMode(ExecEvalState state,
|
|||
for (const auto& scmd : exec_info.body) {
|
||||
transactional |= scmd.Cid()->IsTransactional();
|
||||
contains_global |= scmd.Cid()->opt_mask() & CO::GLOBAL_TRANS;
|
||||
|
||||
// We can't run no-key-transactional commands in lock-ahead mode currently,
|
||||
// because it means we have to schedule on all shards
|
||||
if (scmd.Cid()->opt_mask() & CO::NO_KEY_TRANSACTIONAL)
|
||||
contains_global = true;
|
||||
|
||||
if (contains_global)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -920,6 +920,12 @@ TEST_F(MultiTest, EvalExpiration) {
|
|||
EXPECT_LE(CheckedInt({"pttl", "x"}), 5000);
|
||||
}
|
||||
|
||||
TEST_F(MultiTest, NoKeyTransactional) {
|
||||
Run({"multi"});
|
||||
Run({"ft._list"});
|
||||
Run({"exec"});
|
||||
}
|
||||
|
||||
class MultiEvalTest : public BaseFamilyTest {
|
||||
protected:
|
||||
MultiEvalTest() : BaseFamilyTest() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue