Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
Sachin Kale committed Aug 27, 2024
1 parent dc35b70 commit f103f01
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ public RemoteSegmentMetadata initializeToSpecificTimestamp(long timestamp) throw
if (lockedMetadataFiles.isEmpty()) {
return null;
}
assert lockedMetadataFiles.size() == 1 : "Expected exactly one metadata file but got " + lockedMetadataFiles;
if (lockedMetadataFiles.size() > 1) {
throw new IOException(

Check warning on line 205 in server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java#L205

Added line #L205 was not covered by tests
"Expected exactly one metadata file matching timestamp: " + timestamp + " but got " + lockedMetadataFiles
);
}
String metadataFile = lockedMetadataFiles.iterator().next();
RemoteSegmentMetadata remoteSegmentMetadata = readMetadataFile(metadataFile);
if (remoteSegmentMetadata != null) {
Expand Down

0 comments on commit f103f01

Please sign in to comment.