mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Fix update position of duplicated keys in memory partition buffer
This commit is contained in:
parent
7602c6c6cb
commit
a6534c3b42
@ -1143,14 +1143,18 @@ private:
|
||||
PaddedPODArray<KeyType> keys_to_update;
|
||||
current_memory_buffer_partition.readKeys(keys_to_update);
|
||||
|
||||
absl::flat_hash_set<KeyType, DefaultHash<KeyType>> updated_keys;
|
||||
|
||||
for (auto key_to_update : keys_to_update)
|
||||
{
|
||||
auto * it = index.find(key_to_update);
|
||||
|
||||
/// If lru cache does not contain old keys
|
||||
if (!it)
|
||||
/// If lru cache does not contain old keys or there were duplicated keys in memory buffer partition
|
||||
if (!it || updated_keys.contains(it->getKey()))
|
||||
continue;
|
||||
|
||||
updated_keys.insert(key_to_update);
|
||||
|
||||
Cell & cell_to_update = it->getMapped();
|
||||
|
||||
cell_to_update.in_memory = false;
|
||||
|
Loading…
Reference in New Issue
Block a user