mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: Invalid key lock strings with squashing (#2341)
* fix: clear shard data in squash preparation
This commit is contained in:
parent
16a0becea5
commit
8c873fd71c
1 changed files with 5 additions and 0 deletions
|
@ -347,6 +347,9 @@ void Transaction::PrepareSquashedMultiHop(const CommandId* cid,
|
||||||
multi_->role = SQUASHER;
|
multi_->role = SQUASHER;
|
||||||
InitBase(db_index_, {});
|
InitBase(db_index_, {});
|
||||||
|
|
||||||
|
// Because squashing already determines active shards by partitioning commands,
|
||||||
|
// we don't have to work with keys manually and can just mark active shards.
|
||||||
|
// The partitioned commands know it's keys and assume they have correct access.
|
||||||
DCHECK_EQ(shard_data_.size(), shard_set->size());
|
DCHECK_EQ(shard_data_.size(), shard_set->size());
|
||||||
for (unsigned i = 0; i < shard_data_.size(); i++) {
|
for (unsigned i = 0; i < shard_data_.size(); i++) {
|
||||||
if (enabled(i)) {
|
if (enabled(i)) {
|
||||||
|
@ -356,6 +359,8 @@ void Transaction::PrepareSquashedMultiHop(const CommandId* cid,
|
||||||
} else {
|
} else {
|
||||||
shard_data_[i].local_mask &= ~ACTIVE;
|
shard_data_[i].local_mask &= ~ACTIVE;
|
||||||
}
|
}
|
||||||
|
shard_data_[i].arg_start = 0;
|
||||||
|
shard_data_[i].arg_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue