Repository navigation
Fix flaky test_kafka_formats_with_broken_message - #111701
antaljanosbenjamin merged 1 commit into
Conversation
The per-format setup produced all messages (including the tail broken message) to the topic before the destination materialized views existed, then created the Kafka table, the data view and the errors view in sequence. Creating the first materialized view starts the streaming loop, so on slow builds the loop could consume and commit the broken message before the errors view was attached. The broken message is then past the committed offset and never reaches the errors view: the data view has its rows but the errors view stays empty, failing the test at "Error row for format X did not appear in kafka_errors_X_mv". Create both materialized views, detach/re-attach the Kafka table, and only then produce the messages, so nothing is consumable until both views exist. This mirrors the fix accepted for the sibling test test_kafka_engine_put_errors_to_stream in ClickHouse#107025. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-7:20260723-214600 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings; bounded: 1 full pass + 1 fix round + 1 delta recheck). Coverage: read the complete changed test, fixtures, helpers, old/new Kafka implementations, the accepted sibling tests, PR metadata, and the supplied CI logs. No blockers, majors, or nits raised. Severity: none. No AGREE/DISAGREE verdicts required (empty finding set). Session id: cron:clickhouse-author-slot-7:20260723-214600 |
|
cc @antaljanosbenjamin - could you review this? It applies the same fix you landed in #107025 (create both materialized views, then detach/attach the Kafka table, before producing) to test_kafka_formats_with_broken_message, which hit the identical ordering race: the streaming loop committed the broken message before the errors view was attached, so the errors view stayed empty. |
|
Workflow [PR], commit [231c36c] Summary: ✅ AI ReviewSummaryThis PR fixes the ordering race in Final VerdictStatus: ✅ Approve |
|
@alexey-milovidov one label ask, plus a nudge on its stalled sibling.
Both fixes hold: over 45 days all 34 materialized-view-race failures of these two tests sit on a tree lacking the corresponding fix and none on a tree that has it (the
Request: Separately, the other half of One residual, since it is a property of the fix I am asking you to spread: the |
…-broken-message Fix flaky test_kafka_formats_with_broken_message (cherry picked from commit 4782cdc)
Backport #111701 to 26.6: Fix flaky test_kafka_formats_with_broken_message
Backport #111701 to 26.7: Fix flaky test_kafka_formats_with_broken_message
…rmats-with-broken-message Fix flaky test_kafka_formats_with_broken_message
|
Backporting further to fix CI |
Backport #111701 to 26.3: Fix flaky test_kafka_formats_with_broken_message
…_broken_message
Fix flaky test_kafka_formats_with_broken_message
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Found by @ alexey-milovidov on #109369 (report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109369&sha=119f160ca922641691ce1c4bf7dffbe6119a5bb1&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29). Unrelated to that PR.
The per-format setup produced the whole batch (including the tail broken message) to the topic, then created the Kafka table, the data materialized view, and the errors materialized view in sequence. Creating the first materialized view starts the streaming loop, so on slow (sanitizer) builds the loop could consume and commit the broken message before the errors materialized view was attached. The broken message is then past the committed offset and never reaches the errors view: the data view has its rows but the errors view stays empty, and the test fails at "Error row for format X did not appear in kafka_errors_X_mv".
Fix: create both materialized views, detach/re-attach the Kafka table, and only then produce the messages, so nothing is consumable until both views exist. This mirrors the same fix already accepted for the sibling test test_kafka_engine_put_errors_to_stream in #107025.
CIDB: 0 master failures, 25 PR failures over 45 days (both create-query parameters, random format each time, across amd_msan / amd_asan_ubsan / amd_tsan / amd_llvm_coverage). #108252 only added a diagnostic guard and a retry bump; it did not address this ordering race.
Version info
26.8.1.92(included in26.8and later)26.7.6.42,26.6.4.31,26.3.33.66