File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
main/java/org/elasticsearch/indices/recovery
test/java/org/elasticsearch/indices/recovery Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 2626import org .apache .lucene .index .IndexCommit ;
2727import org .apache .lucene .store .AlreadyClosedException ;
2828import org .apache .lucene .store .RateLimiter ;
29- import org .elasticsearch .Assertions ;
3029import org .elasticsearch .ElasticsearchException ;
3130import org .elasticsearch .ElasticsearchTimeoutException ;
3231import org .elasticsearch .ExceptionsHelper ;
@@ -515,11 +514,6 @@ public void onTimeout(TimeValue timeout) {
515514 ActionListener .wrap (
516515 checkpoint -> listener .onResponse (new RecoveryTranslogOperationsResponse (checkpoint )),
517516 e -> {
518- if (Assertions .ENABLED ) {
519- if (e instanceof MapperException == false ) {
520- throw new AssertionError ("unexpected failure while replicating translog entry" , e );
521- }
522- }
523517 if (mappingVersionOnTarget < request .mappingVersion () && e instanceof MapperException ) {
524518 retryOnMappingException .accept (e );
525519 } else {
Original file line number Diff line number Diff line change 2323import org .apache .lucene .index .CorruptIndexException ;
2424import org .apache .lucene .index .IndexFormatTooNewException ;
2525import org .apache .lucene .index .IndexFormatTooOldException ;
26+ import org .elasticsearch .Assertions ;
2627import org .elasticsearch .ElasticsearchException ;
2728import org .elasticsearch .ExceptionsHelper ;
2829import org .elasticsearch .Version ;
@@ -351,6 +352,9 @@ public void indexTranslogOperations(
351352 throw new MapperException ("mapping updates are not allowed [" + operation + "]" );
352353 }
353354 if (result .getFailure () != null ) {
355+ if (Assertions .ENABLED ) {
356+ throw new AssertionError ("unexpected failure while replicating translog entry" , result .getFailure ());
357+ }
354358 ExceptionsHelper .reThrowIfNotNull (result .getFailure ());
355359 }
356360 }
Original file line number Diff line number Diff line change @@ -906,6 +906,7 @@ public void testDoNotInfinitelyWaitForMapping() {
906906 }
907907 client ().admin ().indices ().prepareUpdateSettings ("test" ).setSettings (Settings .builder ().put ("index.number_of_replicas" , 1 )).get ();
908908 ensureGreen ("test" );
909+ client ().admin ().indices ().prepareRefresh ("test" ).get ();
909910 assertHitCount (client ().prepareSearch ().get (), numDocs );
910911 }
911912
You can’t perform that action at this time.
0 commit comments