Skip to content

Commit

Permalink
Updating comment and small refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <[email protected]>
  • Loading branch information
Rishikesh1159 committed Apr 12, 2022
1 parent 1670ba1 commit abced8c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 26 deletions.
30 changes: 15 additions & 15 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,7 @@ public void testDeleteOperations() throws Exception {
final String nodeA = internalCluster().startNode();
final String nodeB = internalCluster().startNode();

createIndex(
INDEX_NAME,
Settings.builder()
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, SHARD_COUNT)
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, REPLICA_COUNT)
.put(IndexMetadata.SETTING_SEGMENT_REPLICATION, true)
.build()
);
createIndex(INDEX_NAME);
ensureGreen(INDEX_NAME);
client().prepareIndex(INDEX_NAME).setId("1").setSource("foo", "bar").setRefreshPolicy(WriteRequest.RefreshPolicy.WAIT_UNTIL).get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,11 @@ private ExternalReaderManager createReaderManager(RefreshWarmerListener external

private DirectoryReader getDirectoryReader() throws IOException {
// for segment replication: replicas should create the reader from store and, we don't want an open IW on replicas.
/* We should always wrap replicas with a SoftDeletesDirectoryReaderWrapper as we use soft deletes when segment replication is on for
deletions */
// We should always wrap the DirectoryReader used on replicas with SoftDeletesDirectoryReaderWrapper so that we filter out soft deletes
if (engineConfig.isReadOnly()) {
return new SoftDeletesDirectoryReaderWrapper(DirectoryReader.open(store.directory()), Lucene.SOFT_DELETES_FIELD);
}
return DirectoryReader.open(indexWriter, true, true);
return DirectoryReader.open(indexWriter);
}

@Override
Expand Down

0 comments on commit abced8c

Please sign in to comment.