Skip to content

Commit

Permalink
Create empty index if remote segment store is empty (#6375)
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
sachinpkale authored Feb 20, 2023
1 parent 5b3b557 commit 1904158
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 1904158

Please sign in to comment.