Repository navigation
fix(app): require both block columns for the key-only row details lookup - #3566
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 02e09c8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review✅ No issues found. |
Deep Review✅ No critical issues found. The change is a narrowly-scoped correctness fix: the fast key-only row-details lookup ( 🔵 P3 nitpicks (1)
Reviewers (2): correctness, maintainability. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 461 passed • 1 skipped • 1347s
Tests ran across 4 shards in parallel. |
56349e4 to
1976b46
Compare
A single persisted block column combined with the primary key does not identify a row: _block_offset repeats across insert blocks, _block_number across the rows of one block, and exporter-default tables key on a second-precision TimestampTime. Since #3530 the block columns are also detected from server-level merge_tree_settings, so any table without explicit settings took the key-only path on servers that enable only one of them and could open the wrong row. Use the key-only lookup only when both block columns are persisted; a lone block column is still appended to the full-row lookup as a tiebreaker.
1976b46 to
4502777
Compare
Summary
Clicking a search result could open the wrong row's details when the table persists only one of
_block_number/_block_offset._block_offsetrepeats across insert blocks,_block_numberacross the rows of one block, and the primary key often doesn't break the tie (the OTel exporter default keys on the second-precisionTimestampTime).merge_tree_settings, so on servers that enable only one of them, every table without explicit settings takes this path._part+_part_offsetlookup is the follow-up to restore it.How to reproduce
Starting point:
yarn dev. Set the server default on the dev ClickHouse and restart it:Create an exporter-shaped table and insert three rows as separate inserts, two in the same second:
Add a log source for
default.repro_logs(timestamp columnTimestampTime), then search it for"ESLMARS7L7"over a range covering 2026-11-05 09:00 UTC.On
main:Response x_span_id=ESLMARS7L7row a few times.Request x_span_id=ESOPOZ7FCVabout half the time. The query insystem.query_logisWHERE ServiceName='saruman' AND TimestampTime=... AND toDate(TimestampTime)=... AND _block_offset='0' LIMIT 1.On this branch:
Response x_span_id=ESLMARS7L7; the query also filters onTimestamp,SeverityTextandBody.How to test on Vercel preview
N/A — needs a ClickHouse server default; the demo server's user cannot read
system.merge_tree_settings.References