Skip to content

Commit

Permalink
Create empty index if remote segment store is empty (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#6375) (opensearch-project#6378)

(cherry picked from commit 1904158)

Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] authored Feb 20, 2023
1 parent fdc821d commit 030dab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ private void testRestoreFlow(boolean remoteTranslog, int numberOfIterations, boo
}
}

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/6291")
public void testRemoteSegmentStoreRestoreWithNoDataPostCommit() throws IOException {
testRestoreFlow(false, 1, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ private void recoverFromRemoteStore(IndexShard indexShard, Repository repository
// Download segments from remote segment store
indexShard.syncSegmentsFromRemoteSegmentStore(true);

if (store.directory().listAll().length == 0) {
store.createEmpty(indexShard.indexSettings().getIndexVersionCreated().luceneVersion);
}
if (repository != null) {
syncTranslogFilesFromRemoteTranslog(indexShard, repository);
} else {
Expand Down

0 comments on commit 030dab8

Please sign in to comment.