Recovery: fix MapperException detection during translog ops replay
The current ExceptionsHelper.unwrapCause(exception) requires the incoming exception to support ElasticsearchWrapperException , which TranslogRecoveryPerformer.BatchOperationException doesn't implement. I opted for a more generic solution
This commit is contained in:
parent
5951f2580d
commit
e9d275d3a9
|
@ -306,7 +306,8 @@ public class RecoveryTarget extends AbstractComponent {
|
|||
try {
|
||||
recoveryStatus.indexShard().performBatchRecovery(request.operations());
|
||||
} catch (TranslogRecoveryPerformer.BatchOperationException exception) {
|
||||
if (ExceptionsHelper.unwrapCause(exception) instanceof MapperException == false) {
|
||||
MapperException mapperException = (MapperException) ExceptionsHelper.unwrap(exception, MapperException.class);
|
||||
if (mapperException == null) {
|
||||
throw exception;
|
||||
}
|
||||
// in very rare cases a translog replay from primary is processed before a mapping update on this node
|
||||
|
|
Loading…
Reference in New Issue