Skip to content

Commit

Permalink
Only log exception when not retrying
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbarny committed Oct 6, 2024
1 parent cf23f7c commit 212753e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ private static boolean handleMappingUpdateRequired(
return true;
}
} catch (Exception e) {
logger.info(() -> format("%s mapping update rejected by primary", primary.shardId()), e);
assert result.getId() != null;
onMappingUpdateFailure(e, primary, version, result, context, updateResult, initialMappingVersion);
return true;
}
Expand Down Expand Up @@ -473,6 +471,7 @@ private static void onMappingUpdateFailure(
long currentMappingVersion = primary.mapperService().mappingVersion();
boolean mappingWasConcurrentlyUpdated = currentMappingVersion > initialMappingVersion;
if (mappingWasConcurrentlyUpdated) {
logger.debug(() -> format("%s retrying mapping update due to concurrent modification of mappings", primary.shardId()));
// retry current index request if the mapping was updated concurrently
// when two index requests race to add a conflicting dynamic mapping for the same field,
// the index request whose dynamic mapping update loses the race will fail
Expand All @@ -481,6 +480,7 @@ private static void onMappingUpdateFailure(
context.markOperationAsExecuted(r);
context.resetForMappingUpdateRetry();
} else {
logger.info(() -> format("%s mapping update rejected", primary.shardId()), e);
onComplete(r, context, updateResult);
}
}
Expand Down

0 comments on commit 212753e

Please sign in to comment.