Skip to content

Commit

Permalink
Fix broken test.
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Mar 13, 2023
1 parent ccd5694 commit 3742c1b
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 @@ -53,12 +53,11 @@ public class NRTReplicationReaderManager extends OpenSearchReaderManager {
OpenSearchDirectoryReader reader,
Consumer<Collection<String>> onNewReader,
Consumer<Collection<String>> onReaderClosed
) throws IOException {
) {
super(reader);
currentInfos = unwrapStandardReader(reader).getSegmentInfos();
this.onReaderClosed = onReaderClosed;
this.onNewReader = onNewReader;
onNewReader.accept(currentInfos.files(true));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ public void testReplicaReceivesLowerGeneration() throws Exception {
IndexShard oldPrimary = shards.addReplicaWithExistingPath(primary.shardPath(), primary.routingEntry().currentNodeId());
shards.recoverReplica(oldPrimary);
assertLatestCommitGen(5, oldPrimary);
// commitGen is now 6 instead of 5 bc IE will trim any retained unsafe commits from the replica.
// This now happens as readers incref existing segments.
assertLatestCommitGen(5, replica_2);

numDocs = randomIntBetween(numDocs + 1, numDocs + 10);
Expand Down

0 comments on commit 3742c1b

Please sign in to comment.