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 {
@@ -440,17 +438,7 @@ public void testResyncAfterPrimaryPromotion() throws Exception {
440
438
}
441
439
}
442
440
443
- @ TestLogging (
444
- "_root:DEBUG,"
445
- + "org.elasticsearch.action.bulk:TRACE,"
446
- + "org.elasticsearch.action.get:TRACE,"
447
- + "org.elasticsearch.cluster.service:TRACE,"
448
- + "org.elasticsearch.discovery:TRACE,"
449
- + "org.elasticsearch.indices.cluster:TRACE,"
450
- + "org.elasticsearch.indices.recovery:TRACE,"
451
- + "org.elasticsearch.index.seqno:TRACE,"
452
- + "org.elasticsearch.index.shard:TRACE" )
453
- public void testWaitForPendingSeqNo () throws Exception {
441
+ public void testDoNotWaitForPendingSeqNo () throws Exception {
454
442
IndexMetaData metaData = buildIndexMetaData (1 );
455
443
456
444
final int pendingDocs = randomIntBetween (1 , 5 );
@@ -524,7 +512,7 @@ public void indexTranslogOperations(
524
512
final int indexedDuringRecovery = shards .indexDocs (randomInt (5 ));
525
513
docs += indexedDuringRecovery ;
526
514
527
- assertFalse ("recovery should wait on pending docs" , opsSent .get ());
515
+ assertBusy (() -> assertFalse ("recovery should not wait for on pending docs" , opsSent .get () ));
528
516
529
517
primaryEngineFactory .releaseLatchedIndexers ();
530
518
pendingDocsDone .await ();
@@ -533,10 +521,6 @@ public void indexTranslogOperations(
533
521
recoveryFuture .get ();
534
522
535
523
assertThat (newReplica .recoveryState ().getIndex ().fileDetails (), empty ());
536
- assertThat (newReplica .recoveryState ().getTranslog ().recoveredOperations (),
537
- // we don't know which of the inflight operations made it into the translog range we re-play
538
- both (greaterThanOrEqualTo (docs -indexedDuringRecovery )).and (lessThanOrEqualTo (docs )));
539
-
540
524
shards .assertAllEqual (docs );
541
525
} finally {
542
526
primaryEngineFactory .close ();
0 commit comments