Repository navigation
UNIQUE KEY: read - #123008
UNIQUE KEY: read#123008
Conversation
…snapshot, and show the bitmaps in system.parts - ReadSnapshot pins one snapshot per query (MergeTreeData::createStorageSnapshot), held by shared_ptr in SnapshotData, and memoizes each part's bitmap for every reader. - ReadFromMergeTree drops fully dead granules after index analysis, forces _part_offset while a bitmap is non-empty, and gives lazy materialization a snapshot without the bitmaps. - The read pool hands each task its bitmap (MergeTreeReadTask); MergeTreeSelectProcessor applies it; getReadTaskColumns keeps _part_offset after PREWHERE. - count() subtracts dead rows (StorageMergeTree::totalRows*, ReadSnapshot::liveRows). - system.parts.unique_key_bitmap_versions, and the PINNED_BY_DELETE_BITMAP removal-state text. - UniqueKeyBitmapGranulesSkipped and UniqueKeyBitmapRowsSkipped ProfileEvents. - Tests: the Insert cases that read an overwrite back through SELECT: 04105 cases 1-3, 04107, 04168 case 2. Read's own 04163 and 04670 make dead rows with DELETE and land with Delete. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [93fad15] Summary: ❌
AI ReviewSummaryThis PR makes Findings❌ Blockers
Tests
Missing context / blind spots
Final VerdictStatus: ❌ Block. Incorporate the minmax and vector-index guards from #124799 into the reviewed stack, with the focused regressions, before merging this read layer. |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes27 object files changed (+130.80 KiB total), 1 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units287 translation units recompiled, 2926 s compile time in total, 286 of them have a recent master baseline. Translation units without a recent master baseline:
Symbol sizes
|
The read snapshot carries its reader's tid, and the storage snapshot and the trivial counts filter parts at that csn and tid: a UNIQUE KEY commit publishes its part Active before its commit point, so an overwritten key read twice while it committed. 04196 pauses an INSERT between the two. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…t/read Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…t/read Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nFilter, simpler dead-granule pruning Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…x, so clang-tidy sees the write Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # src/Storages/MergeTree/MergeTreeReaderIndex.cpp
alesapin
left a comment
There was a problem hiding this comment.
LGTM, but let's rename ReadSnapshot
| void TransactionManager::tryFinalizeUnknownStateTransactions() | ||
| { | ||
| /// Test-only: keeps the undetermined state observable; returning, not pausing, leaves `loadEntries` running. | ||
| fiu_do_on(FailPoints::transaction_hold_unknown_state, { return; }); |
There was a problem hiding this comment.
It will return from the scope of lambda inside failpoint, not from tryFinalizeUnknownStateTransactions. Basically it's noop.
There was a problem hiding this comment.
#define fiu_do_on(name, action) \
do { \
if (atomic_load_explicit(&has_any_failpoint_been_registered, memory_order_relaxed)) [[unlikely]] { \
if (fiu_fail(name)) [[unlikely]] { \
action; \
} \
} \
} while (0)
it's not a lambda, but just the loop body ?
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
📊 Cloud Performance Report ✅ AI verdict: Baseline selected using StressHouse version hint 26.11.1.42530; measured build ancestry could not be verified. Measured differences are not attributed to this PR. ⚙️ Master level shift inside the baseline window (~2026-10-18 01:11:42): 2 queries have too few matching-era checks to re-baseline. no significant changes detected. K_source=6 K_base=23 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
…t-124131-parquet-prewhere-dictionary-replicated Conflicts with the `Parquet` columns cache (#123008): - `ReadManager::read`: keep `convertToFullColumnIfReplicated` with the new `getOrFormOutputColumn(row_group, ...)` signature. - `Reader.cpp`: keep both sets of profile events. - `05055` and `05339`: keep `AND id < 100000` from this PR and `use_columns_cache = 0` from master.
… written to the columns cache After merging master, the column read by the last `PREWHERE` step could be both decoded as a `ColumnReplicated` of dictionary values (`decode_dictionary_as_replicated`) and written to the columns cache (#123008), which would put a `ColumnReplicated` into the cache. Skip `decode_dictionary_as_replicated` for such a column, the same way `string_value_filter` is skipped for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Column comments of system tables are rendered verbatim into the generated docs pages. The comment added in ClickHouse#123008 named the sidecar files as 'for_<target>' and '<csn>_for_<target>', so MDX parsed `<target>` as an unclosed JSX tag and `mint validate` dropped parts.mdx and dropped_tables_parts.mdx from the build (robot docs regeneration PR ClickHouse#126475, `Validate docs.json`). Write the two patterns as inline code, as other system column comments do for placeholders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #103486
A SELECT on a UNIQUE KEY table now skips the rows its delete bitmaps kill: the query pins one bitmap
snapshot, index analysis drops granules whose rows are all dead, the reader filters the rest by
_part_offset, andcount()subtracts dead rows.Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/123008]
Version info
26.11.1.145-master(included in26.11and later)