Repository navigation
Fix flaky test_async_metadata_refresh - #130493
Conversation
With a 5 s async prefetch period, the refresher can pick up the appended snapshot between the upload and the SELECT, so the count is already 200. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [33c1a35] Summary: ✅
AI ReviewSummaryThe PR adds a failpoint to preserve stale-read coverage in Missing context / blind spots
Findings
Tests
Final VerdictStatus: |
antoniofilipovic
left a comment
There was a problem hiding this comment.
I suggest different fix if possible, but for sake of unblocking PR, LGTM
…tadata_refresh Add the `iceberg_metadata_prefetch_pause` failpoint at the start of `backgroundMetadataPrefetcherThread`. The test pauses the refresher before the Spark append, so the stale-count check is deterministic again, and polls for the refreshed count instead of sleeping for two refresh periods. Related: #130493 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@antoniofilipovic the failpoint is not a lot of code. Let's keep the coverage |
| # Hold the refresher before it reads the latest metadata, so the next SELECT must see stale data | ||
| instance.query("SYSTEM ENABLE FAILPOINT iceberg_metadata_prefetch_pause") | ||
| try: | ||
| instance.query("SYSTEM WAIT FAILPOINT iceberg_metadata_prefetch_pause PAUSE") |
There was a problem hiding this comment.
[P2] Ensure the paused refresher belongs to this test's table
iceberg_metadata_prefetch_pause is server-wide and registered as PAUSEABLE_ONCE, so this wait only proves that some Iceberg table paused. With the documented --count / --repeat-scope=function mode, the package-scoped cluster survives between repetitions, and this test never drops its UUID-named table. A previous repetition's refresher can therefore consume the one-shot failpoint; this wait returns while the current table continues refreshing, and the stale-count assertion can still fail with 200 == 100 after the upload. Please drop the table with DROP TABLE ... SYNC in cleanup covering the entire test (after releasing the failpoint), or scope the pause/acknowledgement to the current table, then verify repeated execution in the same cluster.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units10 translation units recompiled, 32 s compile time in total, 10 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.18 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Backport #130493 to 26.10: Fix flaky test_async_metadata_refresh
Cherry pick #130493 to 26.8: Fix flaky test_async_metadata_refresh
Cherry pick #130493 to 26.9: Fix flaky test_async_metadata_refresh
Backport #130493 to 26.8: Fix flaky test_async_metadata_refresh
Backport #130493 to 26.9: Fix flaky test_async_metadata_refresh
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
test_storage_iceberg_with_spark/test_async_metadata_refresh.py::test_async_metadata_refresh[s3]fails withassert 200 == 100at the stale-count check after the Spark append.The table is created with
iceberg_metadata_async_prefetch_period_ms = 5000. The background refresher (backgroundMetadataPrefetcherThread) runs every 5 seconds. When it runs between the moment the new metadata lands in S3 and the followingSELECT, thatSELECTalready sees 200 rows. The window grows when the upload and the query are slow, so the failure shows up mostly on sanitizer builds.This PR adds the
iceberg_metadata_prefetch_pausefailpoint at the start ofbackgroundMetadataPrefetcherThread, as suggested in review. The test pauses the refresher (SYSTEM WAIT FAILPOINT ... PAUSE) before the Spark append, checks the stale count of 100, then releases the refresher. Instead of sleeping for two refresh periods, it now polls until the refreshed count of 200 is visible, then checks that the refresher read from S3 (S3ReadRequestsCountgrew).CI history over the last 90 days: 53 failures on
master, 24 onrelease/26.6(about 1.2% of runs there), allassert 200 == 100. No tracking issue or other fix exists.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130493]
Version info
26.11.1.1901-master(included in26.11and later)