Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <[email protected]>
  • Loading branch information
dreamer-89 committed Aug 1, 2023
1 parent dc79593 commit 330e712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4660,7 +4660,8 @@ public void syncSegmentsFromRemoteSegmentStore(boolean overrideLocal, boolean re
long processedLocalCheckpoint = Long.parseLong(infosSnapshot.getUserData().get(LOCAL_CHECKPOINT_KEY));
store.commitSegmentInfos(infosSnapshot, processedLocalCheckpoint, processedLocalCheckpoint);
Collection<String> currentInfoFiles = infosSnapshot.files(true);
if (recoveryState.getStage() != RecoveryState.Stage.DONE) {
// For recovering shards, clean up un-usable incremental refresh files.
if (state() != IndexShardState.STARTED) {
for (String localFile : storeDirectory.listAll()) {
if (Store.isAutogenerated(localFile) == false && currentInfoFiles.contains(localFile) == false) {
storeDirectory.deleteFile(localFile);
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/opensearch/index/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public Map<String, StoreFileMetadata> getSegmentMetadataMap(SegmentInfos segment
public static RecoveryDiff segmentReplicationDiff(Map<String, StoreFileMetadata> source, Map<String, StoreFileMetadata> target) {
final List<StoreFileMetadata> identical = new ArrayList<>();
final List<StoreFileMetadata> different = new ArrayList<>();
List<StoreFileMetadata> missing = new ArrayList<>();
final List<StoreFileMetadata> missing = new ArrayList<>();
for (StoreFileMetadata value : source.values()) {
if (value.name().startsWith(IndexFileNames.SEGMENTS)) {
continue;
Expand Down

0 comments on commit 330e712

Please sign in to comment.