Skip to content

Commit

Permalink
changes to test
Browse files Browse the repository at this point in the history
Signed-off-by: Poojita Raj <poojiraj@amazon.com>
  • Loading branch information
Poojita-Raj committed Nov 4, 2022
1 parent 80ef959 commit eeeae29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void testIndexReopenClose() throws Exception {
client().prepareIndex(INDEX_NAME).setId("1").setSource("foo", "bar").setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get();
refresh(INDEX_NAME);

final int initialDocCount = scaledRandomIntBetween(10000, 200000);
final int initialDocCount = scaledRandomIntBetween(100, 200);
try (
BackgroundIndexer indexer = new BackgroundIndexer(
INDEX_NAME,
Expand All @@ -259,20 +259,13 @@ public void testIndexReopenClose() throws Exception {
) {
indexer.start(initialDocCount);
waitForDocs(initialDocCount, indexer);
refresh(INDEX_NAME);
flush(INDEX_NAME);
waitForReplicaUpdate();
}

flushAndRefresh(INDEX_NAME);
waitForReplicaUpdate();

logger.info("--> Closing the index ");
client().admin().indices().prepareClose(INDEX_NAME).get();

// Add another node to kick off TransportNodesListGatewayStartedShards which fetches latestReplicationCheckpoint for SegRep enabled
// indices
final String replica2 = internalCluster().startNode();

logger.info("--> Opening the index");
client().admin().indices().prepareOpen(INDEX_NAME).get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public synchronized void updateSegments(final SegmentInfos infos, long seqNo) th
// lower/higher gens are possible from a new primary that was just elected.
if (incomingGeneration != lastReceivedGen) {
commitSegmentInfos();
translogManager.getDeletionPolicy().setLocalCheckpointOfSafeCommit(seqNo);
translogManager.rollTranslogGeneration();
}
lastReceivedGen = incomingGeneration;
Expand Down

0 comments on commit eeeae29

Please sign in to comment.