From 3e0aa644e717d9f74de45092b0cbe806ee18fb60 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Fri, 1 Mar 2019 18:12:31 -0500 Subject: [PATCH 1/2] Assert recovery done in testDoNotWaitForPendingSeqNo --- .../RecoveryDuringReplicationTests.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java index e387ecaca3d24..74ded2d749099 100644 --- a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java +++ b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java @@ -488,20 +488,14 @@ protected EngineFactory getEngineFactory(ShardRouting routing) { IndexShard newReplica = shards.addReplicaWithExistingPath(replica.shardPath(), replica.routingEntry().currentNodeId()); CountDownLatch recoveryStart = new CountDownLatch(1); - AtomicBoolean opsSent = new AtomicBoolean(false); + AtomicBoolean recoveryDone = new AtomicBoolean(false); final Future recoveryFuture = shards.asyncRecoverReplica(newReplica, (indexShard, node) -> { recoveryStart.countDown(); return new RecoveryTarget(indexShard, node, recoveryListener, l -> {}) { @Override - public void indexTranslogOperations( - final List operations, - final int totalTranslogOps, - final long maxSeenAutoIdTimestamp, - final long msu, - final RetentionLeases retentionLeases, - final ActionListener listener) { - opsSent.set(true); - super.indexTranslogOperations(operations, totalTranslogOps, maxSeenAutoIdTimestamp, msu, retentionLeases, listener); + public void finalizeRecovery(long globalCheckpoint, ActionListener listener) { + recoveryDone.set(true); + super.finalizeRecovery(globalCheckpoint, listener); } }; }); @@ -512,7 +506,7 @@ public void indexTranslogOperations( final int indexedDuringRecovery = shards.indexDocs(randomInt(5)); docs += indexedDuringRecovery; - assertBusy(() -> assertFalse("recovery should not wait for on pending docs", opsSent.get())); + assertBusy(() -> assertTrue("recovery should not wait for on pending docs", recoveryDone.get())); primaryEngineFactory.releaseLatchedIndexers(); pendingDocsDone.await(); From 1f6ab13a093c0ed189416569c3b6ac5c7085edd6 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Sat, 2 Mar 2019 09:27:00 -0500 Subject: [PATCH 2/2] Revert "Mute testDoNotWaitForPendingSeqNo" This reverts commit 9f130a5fbc327194522d5e30360fd99cbd8e3f84. --- .../index/replication/RecoveryDuringReplicationTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java index a107c86c102d9..74ded2d749099 100644 --- a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java +++ b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java @@ -438,7 +438,6 @@ public void testResyncAfterPrimaryPromotion() throws Exception { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/39510") public void testDoNotWaitForPendingSeqNo() throws Exception { IndexMetaData metaData = buildIndexMetaData(1);