Skip to content

Commit dd78ff2

Browse files
authored
Remove RecoverySourceHandler#shardId (#95401)
This field is only used as a prefix for log messages, but the logger already uses a prefix which includes the full shard ID (not just the number) so there's no need to write the number again.
1 parent 97482ce commit dd78ff2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

server/src/main/java/org/elasticsearch/indices/recovery/RecoverySourceHandler.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public class RecoverySourceHandler {
110110
protected final Logger logger;
111111
// Shard that is going to be recovered (the "source")
112112
private final IndexShard shard;
113-
private final int shardId;
114113
// Request containing source and target node information
115114
private final StartRecoveryRequest request;
116115
private final int chunkSizeInBytes;
@@ -142,7 +141,6 @@ public RecoverySourceHandler(
142141
this.threadPool = threadPool;
143142
this.recoveryPlannerService = recoveryPlannerService;
144143
this.request = request;
145-
this.shardId = this.request.shardId().id();
146144
this.logger = Loggers.getLogger(getClass(), request.shardId(), "recover to " + request.targetNode().getName());
147145
this.chunkSizeInBytes = fileChunkSizeInBytes;
148146
this.maxConcurrentFileChunks = maxConcurrentFileChunks;
@@ -1433,7 +1431,7 @@ private void handleErrorOnSendFiles(Store store, Exception e, StoreFileMetadata[
14331431
cancellableThreads.checkForCancel();
14341432
logger.debug("checking integrity for file {} after remove corruption exception", md);
14351433
if (store.checkIntegrityNoException(md) == false) { // we are corrupted on the primary -- fail!
1436-
logger.warn("{} Corrupted file detected {} checksum mismatch", shardId, md);
1434+
logger.warn("Corrupted file detected {} checksum mismatch", md);
14371435
if (localException == null) {
14381436
localException = corruptIndexException;
14391437
}
@@ -1449,12 +1447,7 @@ private void handleErrorOnSendFiles(Store store, Exception e, StoreFileMetadata[
14491447
);
14501448
remoteException.addSuppressed(e);
14511449
logger.warn(
1452-
() -> format(
1453-
"%s Remote file corruption on node %s, recovering %s. local checksum OK",
1454-
shardId,
1455-
request.targetNode(),
1456-
mds
1457-
),
1450+
() -> format("Remote file corruption on node %s, recovering %s. local checksum OK", request.targetNode(), mds),
14581451
corruptIndexException
14591452
);
14601453
throw remoteException;

0 commit comments

Comments
 (0)