75
75
import java .util .stream .Collectors ;
76
76
77
77
import static org .hamcrest .Matchers .anyOf ;
78
- import static org .hamcrest .Matchers .both ;
79
78
import static org .hamcrest .Matchers .empty ;
80
79
import static org .hamcrest .Matchers .equalTo ;
81
80
import static org .hamcrest .Matchers .everyItem ;
82
81
import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
83
82
import static org .hamcrest .Matchers .is ;
84
83
import static org .hamcrest .Matchers .isIn ;
85
84
import static org .hamcrest .Matchers .lessThan ;
86
- import static org .hamcrest .Matchers .lessThanOrEqualTo ;
87
85
import static org .hamcrest .Matchers .not ;
88
86
89
87
public class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestCase {
@@ -441,17 +439,7 @@ public void testResyncAfterPrimaryPromotion() throws Exception {
441
439
}
442
440
}
443
441
444
- @ TestLogging (
445
- "_root:DEBUG,"
446
- + "org.elasticsearch.action.bulk:TRACE,"
447
- + "org.elasticsearch.action.get:TRACE,"
448
- + "org.elasticsearch.cluster.service:TRACE,"
449
- + "org.elasticsearch.discovery:TRACE,"
450
- + "org.elasticsearch.indices.cluster:TRACE,"
451
- + "org.elasticsearch.indices.recovery:TRACE,"
452
- + "org.elasticsearch.index.seqno:TRACE,"
453
- + "org.elasticsearch.index.shard:TRACE" )
454
- public void testWaitForPendingSeqNo () throws Exception {
442
+ public void testDoNotWaitForPendingSeqNo () throws Exception {
455
443
IndexMetaData metaData = buildIndexMetaData (1 );
456
444
457
445
final int pendingDocs = randomIntBetween (1 , 5 );
@@ -525,7 +513,7 @@ public void indexTranslogOperations(
525
513
final int indexedDuringRecovery = shards .indexDocs (randomInt (5 ));
526
514
docs += indexedDuringRecovery ;
527
515
528
- assertFalse ("recovery should wait on pending docs" , opsSent .get ());
516
+ assertBusy (() -> assertFalse ("recovery should not wait for on pending docs" , opsSent .get () ));
529
517
530
518
primaryEngineFactory .releaseLatchedIndexers ();
531
519
pendingDocsDone .await ();
@@ -534,10 +522,6 @@ public void indexTranslogOperations(
534
522
recoveryFuture .get ();
535
523
536
524
assertThat (newReplica .recoveryState ().getIndex ().fileDetails (), empty ());
537
- assertThat (newReplica .recoveryState ().getTranslog ().recoveredOperations (),
538
- // we don't know which of the inflight operations made it into the translog range we re-play
539
- both (greaterThanOrEqualTo (docs -indexedDuringRecovery )).and (lessThanOrEqualTo (docs )));
540
-
541
525
shards .assertAllEqual (docs );
542
526
} finally {
543
527
primaryEngineFactory .close ();
0 commit comments