fix(metadata-table): follow-ups for the zero-size file skip (#18611) - #19355
Merged
Conversation
…le on MDT initialize Adds testUpsertAfterSkippingZeroSizeFileOnInitialize to TestRecordLevelIndex to cover the scenario where SKIP_ZERO_SIZE_FILES_ON_INITIALIZE is enabled: - corrupts the sole base file to zero-size and forces MDT rebootstrap - verifies upsert succeeds and writes to a new file group (not the zero-size one) - validates RLI completeness and that the zero-size fileId is absent from MDT Uses GLOBAL_RECORD_LEVEL_INDEX so bootstrap always creates the minimum 10 file groups for record_index even when all data files were skipped as zero-size.
… skip - honor hoodie.metadata.skip.zero.size.files.on.initialize in the restore-sync relisting so restore does not re-add files that were skipped at initialization - document that skipped files remain on storage untracked by MDT and the cleaner, and must be removed manually - correct the config sinceVersion to 1.3.0 - move the metric name into HoodieMetadataMetrics and only emit it when files were actually skipped - aggregate the per-file WARN into one WARN per partition, with the individual paths at DEBUG
voonhous
force-pushed
the
follow-up-18611-zero-size-skip
branch
from
July 23, 2026 03:54
2cdb883 to
c2767ce
Compare
danny0405
approved these changes
Jul 23, 2026
Collaborator
Contributor
|
The |
voonhous
enabled auto-merge (squash)
July 23, 2026 07:14
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.
Describe the issue this Pull Request addresses
Follow-up to #18611, which added the opt-in config
hoodie.metadata.skip.zero.size.files.on.initialize(skip zero-size data files while listing the data table during MDT initialization). #19243 was a duplicate submission of the same branch and collected review comments that apply to the merged code; it is now closed. This PR addresses those comments and carries over the E2E test from #19243 that never merged (cherry-picked with authorship preserved, thanks @lokeshj1703 @nada-attia).Summary and Changelog
update(HoodieRestoreMetadata, ...)passedskipZeroSizeFiles=falseunconditionally, so a restore would diff the filesystem against MDT, see the files skipped at initialization as FS-only, and re-add them viapartitionFilesToAdd-- re-introducing the failure the config exists to avoid (e.g. the column-stats restore build reading a zero-size parquet footer). With the config enabled, restore now skips them too, and zero-size files already tracked in MDT are removed by the restore sync, converging MDT to the configured semantics.sinceVersionto 1.3.0 (it first ships in 1.3.0, not 1.2.0).HoodieMetadataMetrics.SKIPPED_ZERO_SIZE_FILES_ON_INITIALIZE_STRalongside the other metric-name constants, and only emit it when files were actually skipped (previously an unconditional 0 was emitted on every listing, including restore).TestRecordLevelIndex.testUpsertAfterSkippingZeroSizeFileOnInitialize): after a zero-size base file is skipped during MDT bootstrap with global RLI, an upsert of the affected records succeeds, routes them to a new file group (never the zero-size one), and leaves RLI consistent with the data.Impact
None by default. With the config enabled, restore-sync now treats zero-size files the same way initialization does instead of re-adding them to MDT. The
skipped_zero_size_files_on_initializemetric is now only emitted when non-zero.Risk Level
low. All behavior changes are gated behind the default-off config; the metric/logging changes are observability-only.
Documentation Update
None beyond the updated config description (the website config reference is generated from it).
Contributor's checklist