Repository navigation
async insert deduplication with materialized view - #89140
Conversation
6ff7258 to
f96b2b9
Compare
|
Workflow [PR], commit [ae44682] Summary: ❌
|
| for (auto & path : conflict_block_ids_paths) | ||
| conflict_block_ids.push_back(fs::path(path).filename()); | ||
|
|
||
| auto deduplicated_block = partition.block_with_partition.deduplication_info->deduplicateBlock( |
There was a problem hiding this comment.
The main point of this change is here.
DeduplicationInfo rebuilds block by filtering the original block and reapplying all the transformations from the relevant materialized views.
3c48318 to
59a9004
Compare
8b021f3 to
2d9a6ea
Compare
e62c9e7 to
404c97c
Compare
|
@CheSema when are we expecting this to be live please? |
It would be merged in master in a week or two: it is a lot of code to review. |
There was a problem hiding this comment.
Pull request overview
This PR implements async insert deduplication with dependent materialized views. When a collision by block_id occurs during async inserts, the system now filters the original block to remove conflicting rows and transforms the remaining data through all relevant materialized views' SELECT queries, effectively rebuilding the original block without duplicates.
Key Changes:
- Replaced token-based deduplication with a comprehensive
DeduplicationInfoclass that tracks insert dependencies and handles retry logic - Modified async insert processing to support deduplication with materialized views by filtering and retrying conflicting blocks
- Updated test infrastructure to exclude quorum-based tests from async insert execution
Reviewed changes
Copilot reviewed 96 out of 96 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/Interpreters/InsertDeduplication.{h,cpp} |
New comprehensive deduplication tracking system with retry logic |
src/Interpreters/InsertDependenciesBuilder.{h,cpp} |
Enhanced to support deduplication retry chains for materialized views |
src/Storages/MergeTree/ReplicatedMergeTreeSink.{h,cpp} |
Unified async/sync insert handling with collision detection and retry |
src/Storages/MergeTree/MergeTreeSink.{h,cpp} |
Added collision detection and retry logic for non-replicated tables |
src/Processors/Transforms/DeduplicationTokenTransforms.{h,cpp} |
Simplified token transforms, removed debug-only checking code |
src/Storages/MergeTree/EphemeralLockInZooKeeper.{h,cpp} |
Changed block ID handling from template to vector-based |
tests/queries/0_stateless/03735_*.{sql,reference} |
New tests validating async insert deduplication with materialized views |
tests/queries/0_stateless/*_quorum*.sql |
Added no-async-insert tag to exclude incompatible tests |
Comments suppressed due to low confidence (6)
tests/queries/0_stateless/03733_async_insert_not_supported.reference:1
- Corrected spelling of 'sutable' to 'suitable'
tests/queries/0_stateless/03733_async_insert_not_supported.sql:1 - Corrected spelling of 'sutable' to 'suitable'
src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:1 - Corrected spelling of 'tokets' to 'tokens'
src/Storages/MergeTree/MergeTreeSink.cpp:1 - Corrected spelling of 'tokets' to 'tokens'
tests/queries/0_stateless/03720_insert_mem_no_self_deduplication.sql:1 - Corrected spelling of 'excpect' to 'expect'
tests/queries/0_stateless/03733_async_insert_not_supported.sql:1 - Corrected spelling of 'chech' to 'check'
| std::string partition_id; | ||
| DeduplicationInfo::Ptr deduplication_info; |
There was a problem hiding this comment.
Do not see how, it is convenient to pas them here to the finishDelayedChunk call
There was a problem hiding this comment.
I moved deduplication_info out of here, but partition_id is just convenient to be here.
|
I have here the issue with the I need to address this. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Async insert deduplication now works with dependent materialized views. When collision by block_id occurs, the original block is filtered to remove rows associated with the block_id, and the remaining rows are transformed with all relevant materialized views select queries, this rebuilds original block without conflicting rows.
Documentation entry for user-facing changes