Handle already closed while filling gaps
We can hit an already closed exception when filling the gaps after blocking operations when updating the primary term on a promoted replica shard. We should catch this and suppress it as it is an expected outcome instead of letting it bubble up which leads to trying to fail the shard which throws yet another already closed exception. Relates #25021
This commit is contained in:
parent
5e7a79636d
commit
7ebba35c32
|
@ -370,7 +370,11 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
|
|||
TimeUnit.MINUTES,
|
||||
() -> {
|
||||
latch.await();
|
||||
getEngine().fillSeqNoGaps(newPrimaryTerm);
|
||||
try {
|
||||
getEngine().fillSeqNoGaps(newPrimaryTerm);
|
||||
} catch (final AlreadyClosedException e) {
|
||||
// okay, the index was deleted
|
||||
}
|
||||
},
|
||||
e -> failShard("exception during primary term transition", e));
|
||||
primaryTerm = newPrimaryTerm;
|
||||
|
|
Loading…
Reference in New Issue