Skip to content

Commit

Permalink
Add logs to debug NoSuchFileException during segments upload (opensea…
Browse files Browse the repository at this point in the history
…rch-project#8475)

Signed-off-by: Ashish Singh <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
ashking94 authored and shiv0408 committed Apr 25, 2024
1 parent 1b3c384 commit 6a30b76
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,17 @@ private synchronized void syncSegments(boolean isRetry) {
// Each metadata file in the remote segment store represents a commit and the following
// statement keeps sure that each metadata will always contain all the segments from last commit + refreshed
// segments.
localSegmentsPostRefresh.addAll(SegmentInfos.readCommit(storeDirectory, latestSegmentInfos.get()).files(true));
SegmentInfos segmentCommitInfos;
try {
segmentCommitInfos = SegmentInfos.readCommit(storeDirectory, latestSegmentInfos.get());
} catch (Exception e) {
// Seeing discrepancy in segment infos and files on disk. SegmentInfosSnapshot is returning
// a segment_N file which does not exist on local disk.
logger.error("Exception occurred while SegmentInfos.readCommit(..)", e);
logger.error("segmentInfosFiles={} diskFiles={}", localSegmentsPostRefresh, storeDirectory.listAll());
throw e;
}
localSegmentsPostRefresh.addAll(segmentCommitInfos.files(true));
segmentInfosFiles.stream()
.filter(file -> !file.equals(latestSegmentInfos.get()))
.forEach(localSegmentsPostRefresh::remove);
Expand Down

0 comments on commit 6a30b76

Please sign in to comment.