Repository navigation
[MINOR] Check for the .hoodie folder before loading a Hudi meta client - #1031
Open
the-other-tim-brown wants to merge 3 commits into
Open
the-other-tim-brown wants to merge 3 commits into
the-other-tim-brown wants to merge 3 commits into
Conversation
Hudi only reports a missing table after retrying the read of hoodie.properties five times with one-second sleeps, so every first sync to a new Hudi target waited ~5s. Check for the .hoodie folder first, as Hudi's own writers do (FSUtils.isTableExists).
the-other-tim-brown
marked this pull request as ready for review
November 25, 2026 18:04
This branch has not been deployed
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.
What is the purpose of the pull request
Every first sync to a new Hudi target waited about 5 seconds for nothing.
HudiTableManager.loadTableMetaClientIfExistsandHudiBackedSecondaryIndexUtils.getMetaClientfind out a table is missing by catchingTableNotFoundException. In Hudi 1.x that exception is thrown only afterHoodieTableConfighas tried to readhoodie.propertiesand 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
.hoodiefolder before they build a meta client:FSUtils.isTableExists,HoodieSparkSqlWriterand Flink'sStreamerUtil.tableExists. This PR does the same.Brief change log
HudiTableManager.metaFolderExists, which delegates to Hudi'sFSUtils.isTableExists.loadTableMetaClientIfExistsreturns empty, andHudiBackedSecondaryIndexUtils.getMetaClientthrowsTableNotFoundException, without waiting for the retries. Existing callers are unchanged..hoodiefolder 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:
Verify this pull request
This pull request is already covered by existing tests: ITHudiConversionTarget, ITHudiBackedSecondaryIndex, ITConversionController and TestHudiTableManager.
🤖 Generated with Claude Code