Repository navigation
Make 04329_iceberg_insert_stale_schema_field_id_107268 own its cache state - #113232
PedroTadim merged 1 commit into
Conversation
The test needs INSERT analysis to serve a stale schema while the sink force-reads the latest one. It built that by warming the server-global Iceberg metadata files cache and relying on the entry surviving to the INSERT. That cache is SLRU-bounded at 1000 entries and shared with every other test on the server, so a cache left at its bound by earlier tests evicts the entry: the INSERT reads fresh, both views agree, and the rejection correctly does not fire. A second defect made that silent. Both oracles were `grep -oF "INCORRECT_DATA"`, which prints nothing for a successful INSERT and nothing for a different error code, so the reference diff could not distinguish a wrong error code from no error at all, and in the opposite cache state the test passed vacuously. Clear the cache immediately before each warm-up SELECT so the test owns the state it depends on, and report the actual outcome for every outcome (the error code name, or NO_ERROR). The reference file is unchanged, so the rejection must still fire in both scenarios; a run that stops exercising it now fails and names what happened instead of passing. no-parallel is kept, and its comment now states the real reason: the test issues a server-global cache clear, so it must be alone on the server. That is the same pairing 03272_prewarm_mark_cache_add_column.sql uses for the mark cache. Validation: with the cache bound lowered to 40 and pre-filled to 40/40 occupancy (measured via IcebergMetadataFilesCacheFiles), the old form fails with a stdout diff byte-identical to the CI failure and the new form passes on that same injected state. 50/50 randomized runs pass. The only other tests using iceberg_metadata_staleness_ms, 04214 and 04337, are not exposed to residual occupancy and are unchanged. Failed 7 times on Stateless tests (arm_asan_ubsan, targeted) across two unrelated PRs, ClickHouse#113010 and ClickHouse#112866.
Internal second-model review (independent cold review + adversarial gate): 0 blockers, 0 majors, 2 nitsBefore opening this PR I ran an independent review of the resulting code without access to the Result: 0 blockers, 0 majors, 2 nits. The gate returned 0 findings; both nits are mine, and I
What the independent review verified from source, rather than taking on trust:
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-45:20260804-021400 |
|
cc @arsenmuk, could you review this? It is a test-only fix: 04329 relied on a warmed entry in the server-global Iceberg metadata files cache surviving to its INSERT, which residual occupancy from other tests evicts, and its grep-based oracle printed nothing for both a successful INSERT and a different error code, so the miss was silent. |
|
Workflow [PR], commit [ff2e349] Summary: ✅ AI ReviewSummaryThis PR makes Final Verdict
|
CI finish ledger - ff2e349Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
176 check-runs, all complete: 58 success, 118 skipped, 0 failures among them. The test this PR changes is green everywhere at this head: Session id: cron:our-pr-ci-monitor:20260804-103000 |
Related: #113010
Related: #109838
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04329_iceberg_insert_stale_schema_field_id_107268failed 7 times onStateless tests (arm_asan_ubsan, targeted)across two unrelated PRs (#113010, #112866), bothexpected
INCORRECT_DATAlines missing each time. It is my test.The test needs INSERT analysis to serve a stale schema while the sink force-reads the latest one, and
built that by warming the server-global Iceberg metadata files cache and hoping the entry survived to
the INSERT. That cache is SLRU-bounded at 1000 entries (
src/Core/Defines.h:121,123) and shared withevery other test, so when earlier tests leave it at its bound the entry is evicted, the INSERT reads
fresh, both views agree, and the rejection correctly does not fire. A second defect hid
that:
grep -oF "INCORRECT_DATA"prints nothing for a successful INSERT and nothing for a differenterror code, so it could not distinguish a wrong code from no error, and in the opposite cache state it
passed vacuously.
The fix clears the cache immediately before each warm-up
SELECT, so the test owns the state itdepends on, and reports the actual outcome for every outcome (error code name, or
NO_ERROR)..referenceis unchanged, so the rejection must still fire twice; a run that stops exercising it nowfails and names why.
no-parallelis kept, now guarding the cache clear, like03272_prewarm_mark_cache_add_column.sql.With the cache bound lowered to 40 and pre-filled to 40/40, the old form fails with a diff
byte-identical to CI and the new form passes on that same state. 50/50 randomized runs pass.
04214and
04337, the only other users oficeberg_metadata_staleness_ms, are not exposed.v3.metadata.jsonis still written directly:ALTER ... RENAME COLUMNcallsinvalidateMetadataCache()and destroys the precondition.04337does the same, but I will move thisto an integration test if you prefer. #109838 also touches these two lines (expecting
BAD_ARGUMENTS), so whichever lands second needs a.referencerebase.Version info
26.8.1.757(included in26.8and later)