File tree 1 file changed +3
-6
lines changed
src/main/java/org/elasticsearch/indices/recovery
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,10 @@ public void run() {
230
230
if ((corruptIndexException = ExceptionsHelper .unwrap (e , CorruptIndexException .class )) != null ) {
231
231
if (store .checkIntegrity (md ) == false ) { // we are corrupted on the primary -- fail!
232
232
logger .warn ("{} Corrupted file detected {} checksum mismatch" , shard .shardId (), md );
233
- CorruptIndexException current = corruptedEngine .get ();
234
- if (current != null || corruptedEngine .compareAndSet (null , corruptIndexException )) {
235
- current = corruptedEngine .get ();
236
- assert current != null ;
237
- current .addSuppressed (e );
233
+ if (corruptedEngine .compareAndSet (null , corruptIndexException ) == false ) {
234
+ // if we are not the first exception, add ourselves as suppressed to the main one:
235
+ corruptedEngine .get ().addSuppressed (e );
238
236
}
239
-
240
237
} else { // corruption has happened on the way to replica
241
238
RemoteTransportException exception = new RemoteTransportException ("File corruption occured on recovery but checksums are ok" , null );
242
239
exception .addSuppressed (e );
You can’t perform that action at this time.
0 commit comments