Repository navigation
Fix flaky queue-log assertions in test_storage_s3_queue - #117954
Merged
Merged
Conversation
`test_delete_after_processing`, `test_tag_after_processing` and `test_move_after_processing` wait for the destination materialized view table to reach its final row count, then issue a single `SYSTEM FLUSH LOGS` and assert on `system.s3queue_log` / `system.azure_queue_log` and the corresponding metadata cache. That is racy: `ObjectStorageQueueSource::appendLogElement` is called from `finalizeCommit`, after the rows have already been committed to the materialized view target, so the log entry may not have been queued yet when the flush happens, and the flush then flushes nothing. The assertion then sees `0` instead of `files_num * row_num`. Replace the one-shot flush and assert with `wait_for_queue_log_rows`, which flushes and polls until the expected counts are reported, in the same shape as `wait_for_object_counts` added in #117066 for the object-count race in the same tests. Observed on #116992 in `Integration tests (arm_binary, distributed plan, 4/4)`: `test_move_after_processing[another_bucket-AzureQueue]` failed with `assert 0 == (5 * 10)` on `SELECT sum(rows_processed) FROM system.azure_queue_log`.
Contributor
|
Workflow [PR], commit [987c0b9] Summary: ✅ AI ReviewSummaryThe PR replaces one-shot queue-log assertions in three Missing context / blind spots
Final VerdictNo new review findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #117066
Related: #116992
test_delete_after_processing,test_tag_after_processingandtest_move_after_processingintests/integration/test_storage_s3_queue/test_0.pywait for the destination materialized view table to reach its final row count, then issue a singleSYSTEM FLUSH LOGSand assert onsystem.s3queue_log/system.azure_queue_logand the corresponding metadata cache.That is racy:
ObjectStorageQueueSource::appendLogElementis called fromfinalizeCommit, that is, only after the rows have already been committed to the materialized view target. The destination row count reaching its expected value therefore does not imply that the log entry has been queued yet, and the flush can flush nothing, after which the assertion reads0instead offiles_num * row_num.Replace the one-shot flush and assert with a
wait_for_queue_log_rowshelper that flushes and polls until the expected counts are reported, in the same shape aswait_for_object_countsadded in #117066 for the object-count race in the very same tests.Observed on #116992, job
Integration tests (arm_binary, distributed plan, 4/4):test_move_after_processing[another_bucket-AzureQueue]failed withassert 0 == (5 * 10)onSELECT sum(rows_processed) FROM system.azure_queue_log. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116992&sha=89a75069566f416b4e13ff62db0732bc1ce1545e&name_0=PR&name_1=Integration%20tests%20(arm_binary,%20distributed%20plan,%204/4)Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/117954]
Version info
26.9.1.726(included in26.9and later)