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:
Boaz Leskes 2015-06-10 17:12:14 +02:00
parent 5951f2580d
commit e9d275d3a9
1 changed files with 2 additions and 1 deletions

View File

@ -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