wombatu-kun opened a new pull request, #19004:
URL: https://github.com/apache/hudi/pull/19004

   ### Describe the issue this Pull Request addresses
   
   The three Trino-plugin tests `TestHudiNoCacheFileOperations`, 
`TestHudiMemoryCacheFileOperations` and `TestHudiAlluxioCacheFileOperations` 
are still flaky after #18995. They intermittently fail in CI with a symmetric 
off-by-N mismatch in the metadata-table file-operation counts between the two 
paired measurements (for example on master CI run 27489081724, `testJoin` was 
long by 49 `Alluxio.readCached` / 7 `lastModified` / 16 `length` while 
`testSelectWithFilter` was short by almost exactly the same amounts). #18995 
disabled the async table-statistics refresh, but that was only one of several 
asynchronous sources of these spans, so the flake remained.
   
   ### Summary and Changelog
   
   These tests assert the exact multiset of low-level filesystem-access spans a 
single query emits. Trino resets the span exporter at the start of each 
`executeWithPlan`, so any span emitted by a background thread after the 
synchronous query returns lands in the next test's measurement window and 
scrambles the counts (the symmetric off-by-N signature). The Hudi read path 
produces such spans from shared background pools that read the metadata table 
(split loading, partition listing, index support) and, in the Alluxio case, 
from asynchronous filesystem-cache population whose hit/miss outcome depends on 
whether an earlier cache write had already completed.
   
   Instead of continuing to try to time these background tasks (a fixed 
`Thread.sleep`, then a span-stability poll in #18766, then disabling stats in 
#18995), this PR stops asserting the quantities they produce and keeps only the 
operations that happen synchronously on the foreground planning/scan path, 
which are well-defined per query. `getFileOperations` now excludes 
`METADATA_TABLE` operations in all three classes and additionally excludes all 
`Alluxio.*` operations in the Alluxio class, and the corresponding expected 
entries are removed. `hudi.table-statistics-enabled=false` is kept because the 
stats executor also reads the index-definition and table-property files on a 
background thread, which are part of the surviving asserted set.
   
   No production code is changed, and no code was copied from third-party 
sources.
   
   ### Impact
   
   Test-only change, scoped to three test classes in `hudi-trino-plugin`. No 
production code, public API, configuration default, or runtime behavior changes.
   
   ### Risk Level
   
   none
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to