Skip to content

Commit 537f4ce

Browse files
authored
Fix log message format bugs (#118354)
1 parent 56379a3 commit 537f4ce

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

docs/changelog/118354.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118354
2+
summary: Fix log message format bugs
3+
area: Ingest Node
4+
type: bug
5+
issues: []

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ public void onResponse(Void unused) {
10251025
// should be no other processes interacting with the repository.
10261026
logger.warn(
10271027
Strings.format(
1028-
"failed to clean up multipart upload [{}] of blob [{}][{}][{}]",
1028+
"failed to clean up multipart upload [%s] of blob [%s][%s][%s]",
10291029
abortMultipartUploadRequest.getUploadId(),
10301030
blobStore.getRepositoryMetadata().name(),
10311031
abortMultipartUploadRequest.getBucketName(),

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/FullClusterRestartDownsampleIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private String getRollupIndexName() throws IOException {
263263
if (asMap.size() == 1) {
264264
return (String) asMap.keySet().toArray()[0];
265265
}
266-
logger.warn("--> No matching rollup name for path [%s]", endpoint);
266+
logger.warn("--> No matching rollup name for path [{}]", endpoint);
267267
return null;
268268
}
269269

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/DownsampleIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private String getRollupIndexName() throws IOException {
238238
if (asMap.size() == 1) {
239239
return (String) asMap.keySet().toArray()[0];
240240
}
241-
logger.warn("--> No matching rollup name for path [%s]", endpoint);
241+
logger.warn("--> No matching rollup name for path [{}]", endpoint);
242242
return null;
243243
}
244244

server/src/internalClusterTest/java/org/elasticsearch/index/seqno/RetentionLeaseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public void testRetentionLeasesSyncOnRecovery() throws Exception {
336336
.getShardOrNull(new ShardId(resolveIndex("index"), 0));
337337
final int length = randomIntBetween(1, 8);
338338
final Map<String, RetentionLease> currentRetentionLeases = new LinkedHashMap<>();
339-
logger.info("adding retention [{}}] leases", length);
339+
logger.info("adding retention [{}] leases", length);
340340
for (int i = 0; i < length; i++) {
341341
final String id = randomValueOtherThanMany(currentRetentionLeases.keySet()::contains, () -> randomAlphaOfLength(8));
342342
final long retainingSequenceNumber = randomLongBetween(0, Long.MAX_VALUE);

server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,12 +3484,10 @@ private static void ensureNotAborted(ShardId shardId, SnapshotId snapshotId, Ind
34843484
// A normally running shard snapshot should be in stage INIT or STARTED. And we know it's not in PAUSING or ABORTED because
34853485
// the ensureNotAborted() call above did not throw. The remaining options don't make sense, if they ever happen.
34863486
logger.error(
3487-
() -> Strings.format(
3488-
"Shard snapshot found an unexpected state. ShardId [{}], SnapshotID [{}], Stage [{}]",
3489-
shardId,
3490-
snapshotId,
3491-
shardSnapshotStage
3492-
)
3487+
"Shard snapshot found an unexpected state. ShardId [{}], SnapshotID [{}], Stage [{}]",
3488+
shardId,
3489+
snapshotId,
3490+
shardSnapshotStage
34933491
);
34943492
assert false;
34953493
}

x-pack/plugin/downsample/src/main/java/org/elasticsearch/xpack/downsample/DownsampleShardIndexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public void collect(int docId, long owningBucketOrd) throws IOException {
386386

387387
if (logger.isTraceEnabled()) {
388388
logger.trace(
389-
"Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> downsample bucket ts: [{}]",
389+
"Doc: [{}] - _tsid: [{}], @timestamp: [{}] -> downsample bucket ts: [{}]",
390390
docId,
391391
DocValueFormat.TIME_SERIES_ID.format(tsidHash),
392392
timestampFormat.format(timestamp),

x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public EnrichPlugin(final Settings settings) {
172172
if (settings.hasValue(CACHE_SIZE_SETTING_NAME)) {
173173
throw new IllegalArgumentException(
174174
Strings.format(
175-
"Both [{}] and [{}] are set, please use [{}]",
175+
"Both [%s] and [%s] are set, please use [%s]",
176176
CACHE_SIZE_SETTING_NAME,
177177
CACHE_SIZE_SETTING_BWC_NAME,
178178
CACHE_SIZE_SETTING_NAME

0 commit comments

Comments
 (0)