Skip to content

Commit

Permalink
Update comment with exact reason for conditional logic.
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
  • Loading branch information
Rishikesh1159 committed Jan 4, 2024
1 parent cc294a8 commit 86f23ee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public MockEngineFactory(Class<? extends FilterDirectoryReader> wrapper) {
@Override
public Engine newReadWriteEngine(EngineConfig config) {

// When Segment Replication is enabled on an index replica shards use NRTReplicationEngine instead of InternalEngine.
/**
* Segment replication enabled replicas (i.e. read only replicas) do not use an InternalEngine so a MockInternalEngine
* will not work and an NRTReplicationEngine must be used instead. The primary shards for these indexes will
* still use a MockInternalEngine.
*/
return config.isReadOnlyReplica() ? new NRTReplicationEngine(config) : new MockInternalEngine(config, wrapper);
}
}

0 comments on commit 86f23ee

Please sign in to comment.