Repository navigation
Conversation
WZhuo
force-pushed
the
refactor/reachable-file-util
branch
29 times, most recently
from
December 5, 2026 22:31
f1ff624 to
6757856
Compare
Add a public ReachableFileUtil mirroring Java's ReachableFileUtil for metadata and statistics file locations, plus manifest helpers that read manifest lists and manifests to find the manifests and live content files of snapshots. ExpireSnapshots' reachable file cleanup uses them. Previous metadata files are not read, which the API documents. Behavior changes beyond the refactor: - Reachable cleanup resolves only the manifest's partition spec when reading live files, instead of building a map of all specs. Expired manifests are resolved against the pre-expiration metadata, which may still hold their specs, and retained manifests against the committed metadata. - ReachableFileUtil reports reader exceptions, such as an avro::Exception from a corrupt file, as InvalidManifestList or InvalidManifest errors that name the file, instead of letting them escape. - Both cleanup paths skip expired manifests that are missing, as before. An IOError counts as missing only if checking the file's size reports NotFound. InputFile::Size() documents that contract, and ArrowFileSystemFileIO now follows it for ENOENT and ENOTDIR. On Windows only a missing file or path counts, not other errors that Arrow maps to ENOENT, such as an unavailable drive or network share. They stop before deleting any file if a manifest exists but cannot be read, fails to decode, or has an unknown partition spec, or if a retained manifest or manifest list cannot be read or is missing, or if an expired manifest list exists but cannot be read, since the data files to delete are then unknown. Previously the reachable path stopped only when a reader threw, and the incremental path treated every failure as an empty manifest. Incremental cleanup reads only the file paths of manifests to scan, so partition values it does not use, such as fixed values the reader cannot decode, do not stop it, and it keeps paths that are live again in a retained snapshot. It reads retained manifests only while some candidate is not yet known to be live, and a retained manifest that cannot be read stops it only if some candidate is not. - AvroReader reports a read error from the input stream instead of treating it as the end of the file, which returned the records read before it as if they were complete. Cleanup could then miss files that a retained manifest still references. Failures outside a split, before it, past its end, or in the start of the next block that Avro reads to find its end, are still ignored, since the split does not need those bytes, including the first block, which Avro reads when opening the file, and a split of no bytes. A read error that makes Avro throw, for example inside the header or a block, is reported as such, not as a malformed file, so a missing file that only fails on its first read, as on S3 with a known length, is still found missing. - RunTasksParallel converts exceptions thrown by Executor::Submit, by a task itself, and broken promises from a dropped task into errors, and waits for all accepted tasks on every exit path, since tasks may reference the caller's state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WZhuo
force-pushed
the
refactor/reachable-file-util
branch
from
December 5, 2026 22:52
6757856 to
8dc88ee
Compare
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.
Add a public ReachableFileUtil mirroring Java's ReachableFileUtil for
metadata and statistics file locations, plus manifest helpers that read
manifest lists and manifests to find the manifests and live content files
of snapshots. ExpireSnapshots' reachable file cleanup uses them.
Previous metadata files are not read, which the API documents.
Behavior changes beyond the refactor:
reading live files, instead of building a map of all specs. Expired manifests are
resolved against the pre-expiration metadata, which may still hold their
specs, and retained manifests against the committed metadata.
from a corrupt file, as InvalidManifestList or InvalidManifest errors
that name the file, instead of letting them escape.
An IOError counts as missing only if checking the file's size reports
NotFound. InputFile::Size() documents that contract, and
ArrowFileSystemFileIO now follows it for ENOENT and ENOTDIR. On Windows
only a missing file or path counts, not other errors that Arrow maps to
ENOENT, such as an unavailable drive or network share.
They stop before deleting any file if a manifest exists but cannot be
read, fails to decode, or has an unknown partition spec, or if a
retained manifest or manifest list cannot be read or is missing, or if
an expired manifest list exists but cannot be read, since the data files
to delete are then unknown. Previously the reachable path stopped only
when a reader threw, and the incremental path treated every failure as
an empty manifest. Incremental cleanup reads only the file paths of
manifests to scan, so partition values it does not use, such as fixed
values the reader cannot decode, do not stop it, and it keeps paths that
are live again in a retained snapshot. It reads retained manifests only
while some candidate is not yet known to be live, and a retained
manifest that cannot be read stops it only if some candidate is not.
treating it as the end of the file, which returned the records read
before it as if they were complete. Cleanup could then miss files that
a retained manifest still references. Failures outside a split, before
it, past its end, or in the start of the next block that Avro reads to
find its end, are still ignored, since the split does not need those
bytes, including the first block, which Avro reads when opening the
file, and a split of no bytes. A read error that makes Avro throw, for example inside
the header or a block, is reported as such, not as a malformed file,
so a missing file that only fails on its first read, as on S3 with a
known length, is still found missing.
task itself, and broken promises from a dropped task into errors, and
waits for all accepted tasks on every exit path, since tasks may
reference the caller's state.
Testing: all 20 test binaries pass (ctest). New tests cover each behavior change and fail when it is reverted. The Windows-specific error classification is not exercised on non-Windows CI.
🤖 Generated with Claude Code