mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #30651 from ClickHouse/fix_intersecting_parts_to_do
Fix intersecting parts in `parts_to_do`
This commit is contained in:
commit
a29711f1d0
@ -203,9 +203,15 @@ void ReplicatedMergeTreeQueue::insertUnlocked(
|
||||
drop_ranges.addDropRange(entry);
|
||||
|
||||
/// DROP PART remove parts, so we remove it from virtual parts to
|
||||
/// preserve invariant virtual_parts = current_parts + queue
|
||||
/// preserve invariant virtual_parts = current_parts + queue.
|
||||
/// Also remove it from parts_to_do to avoid intersecting parts in parts_to_do
|
||||
/// if fast replica will execute DROP PART and assign a merge that contains dropped blocks.
|
||||
if (entry->isDropPart(format_version))
|
||||
virtual_parts.removePartAndCoveredParts(*entry->getDropRange(format_version));
|
||||
{
|
||||
String drop_part_name = *entry->getDropRange(format_version);
|
||||
virtual_parts.removePartAndCoveredParts(drop_part_name);
|
||||
removeCoveredPartsFromMutations(drop_part_name, /*remove_part = */ true, /*remove_covered_parts = */ true);
|
||||
}
|
||||
|
||||
queue.push_front(entry);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ ${CLICKHOUSE_CLIENT} --query="CREATE TABLE mutations_cleaner_r2(x UInt32) ENGINE
|
||||
cleanup_delay_period_random_add = 0"
|
||||
|
||||
# Insert some data
|
||||
${CLICKHOUSE_CLIENT} --query="INSERT INTO mutations_cleaner_r1(x) VALUES (1), (2), (3), (4)"
|
||||
${CLICKHOUSE_CLIENT} --query="INSERT INTO mutations_cleaner_r1(x) VALUES (1), (2), (3), (4), (5)"
|
||||
|
||||
# Add some mutations and wait for their execution
|
||||
${CLICKHOUSE_CLIENT} --query="ALTER TABLE mutations_cleaner_r1 DELETE WHERE x = 1 SETTINGS mutations_sync = 2"
|
||||
|
Loading…
Reference in New Issue
Block a user