Repository navigation
Strengthen QCC TopK test 04338: ProfileEvents usage check, ORDER BY ASC, negative LIMIT - #110381
Conversation
…ative LIMIT Adds system.query_log ProfileEvents assertions (QueryConditionCacheHits) to prove the query condition cache is actually used on the cached run and invalidated after DROP PARTITION, rather than only checking result correctness. Also adds an ORDER BY ASC case (distinct direction key must not reuse the DESC entry) and a negative LIMIT case (NegativeLimit plan, no __topKFilter, so the TopK-QCC path does not engage). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260714-115200 |
|
cc @shankar-iyer for review: test-only follow-up strengthening the QCC TopK part-set-invalidation test with ProfileEvents-based cache-usage assertions, plus ORDER BY ASC and negative LIMIT cases (requested by PedroTadim on #104478). |
|
Workflow [PR], commit [29174af] Summary: ✅ AI ReviewSummaryThis PR strengthens Final VerdictStatus: ✅ Approve |
…gative-LIMIT blocks Address review on 04338: (1) before using the ASC 0-hits as evidence that sort direction is part of the QCC key, prove the warm DESC LIMIT 5 query actually populated a TopK entry by rerunning it and asserting a cache hit; otherwise the ASC miss could be expected for the wrong reason on the one-part post-drop dataset. (2) For negative LIMIT, add a cache-state assertion (QueryConditionCacheHits = 0 on the negative-limit run, so it does not reuse the TopK entry) plus a follow-up positive LIMIT 5 that still hits, proving the negative run neither reuses nor poisons the TopK-salted entries. Test-only. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Head branch was pushed to by a user without write access
|
Both gaps addressed in 6d4c60a (test-only).
Verified deterministic: 10 clean runs plus 20x with randomization enabled, all pass. |
… rerun The post-negative positive rerun used FORMAT Null and only checked QueryConditionCacheHits > 0, so a write-side key collision that overwrote the positive TopK entry while the negative-LIMIT query finished would still show a cache hit and keep the test green. Materialize that rerun and compare it against a use_query_condition_cache = 0 ground truth so a poisoned entry is caught. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gatePre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260714-135900 |
CI finish ledger — 29174afAll checks green. No test-level failures on this head. Only
Session id: cron:our-pr-ci-monitor:20260714-183000 |
…-topk-profileevents-neglimit Strengthen QCC TopK test 04338: ProfileEvents usage check, ORDER BY ASC, negative LIMIT
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Follow-up to the review on merged PR #104478 (@ PedroTadim asked to verify the query condition cache is actually used and to cover negative limits and
ORDER BY ... DESC).Strengthens
04338_query_condition_cache_topk_part_set_invalidation:system.query_logProfileEvents['QueryConditionCacheHits']assertions: the warm run has 0 hits, the cached run has hits, and the run afterDROP PARTITIONhas 0 hits (proving the part-set-salt invalidation, not just a correct result).ORDER BY ... ASCcase. After warmingORDER BY k DESC, anORDER BY k ASCquery must not reuse the DESC entry, sincecondition_hashfolds the sort direction. Asserted via 0 hits.LIMITcase. A negativeLIMITbecomes aNegativeLimitplan step with no__topKFilter, so it never engages the TopK-salted QCC path. Added a correctness case (matches theuse_query_condition_cache = 0ground truth) confirming it neither reuses nor poisons the TopK entries.Verified: 20/20 passes with full randomization; base pass with
--no-random-settings. TheORDER BY ... DESCpath was already covered by the original test.Version info
26.7.1.950(included in26.7and later)