the-other-tim-brown opened a new pull request, #1031:
URL: https://github.com/apache/incubator-xtable/pull/1031

   ## What is the purpose of the pull request
   
   Every first sync to a new Hudi target waited about 5 seconds for nothing.
   
   `HudiTableManager.loadTableMetaClientIfExists` and 
`HudiBackedSecondaryIndexUtils.getMetaClient` find out a table is missing by 
catching `TableNotFoundException`. In Hudi 1.x that exception is thrown only 
after `HoodieTableConfig` has tried to read `hoodie.properties` and its backup 
5 times, sleeping 1 second between attempts (`ConfigUtils.fetchConfigs`). A 
wall-clock profile with async-profiler showed this sleep as the single largest 
cost in the Hudi target ITs.
   
   Hudi's own writers check for the `.hoodie` folder before they build a meta 
client: `FSUtils.isTableExists`, `HoodieSparkSqlWriter` and Flink's 
`StreamerUtil.tableExists`. This PR does the same.
   
   ## Brief change log
   
   - Add `HudiTableManager.metaFolderExists`, which delegates to Hudi's 
`FSUtils.isTableExists`.
   - `loadTableMetaClientIfExists` returns empty, and 
`HudiBackedSecondaryIndexUtils.getMetaClient` throws `TableNotFoundException`, 
without waiting for the retries. Existing callers are unchanged.
   - A table whose `.hoodie` folder already exists still goes through Hudi's 
retry path, which is there to handle concurrent updates to the properties file.
   
   Local results, with 4 JUnit threads:
   
   - ITHudiConversionTarget: 105.8s → 30.5s.
   - The "Could not read properties" warnings, one pair per retry, drop to 0 in 
three IT classes:
   
   | | before | after |
   |---|---|---|
   | ITConversionController | 340 | 0 |
   | ITHudiBackedSecondaryIndex | 250 | 0 |
   | ITHudiConversionTarget | 140 | 0 |
   
   ## Verify this pull request
   
   This pull request is already covered by existing tests: 
ITHudiConversionTarget, ITHudiBackedSecondaryIndex, ITConversionController and 
TestHudiTableManager.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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