feat(cluster): add migration finalization (#2507)

* feat(cluster): add migration finalization
This commit is contained in:
Borys 2024-02-01 17:24:54 +02:00 committed by GitHub
parent adeac6bd27
commit 5189dae118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 174 additions and 25 deletions

View file

@ -307,8 +307,10 @@ void Transaction::InitByKeys(const KeyIndex& key_index) {
unique_shard_cnt_ = 1;
if (is_stub) // stub transactions don't migrate
DCHECK_EQ(unique_shard_id_, Shard(kv_args_.front(), shard_set->size()));
else
else {
unique_slot_checker_.Add(kv_args_.front());
unique_shard_id_ = Shard(kv_args_.front(), shard_set->size());
}
// Multi transactions that execute commands on their own (not stubs) can't shrink the backing
// array, as it still might be read by leftover callbacks.