From 8573571fa134e2147fca9349cf388a26b63cba2b Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 17 Nov 2023 09:09:29 +0000 Subject: [PATCH] Add more trace logging to uncontended register ops (#102306) Relates #102294 --- .../org/elasticsearch/repositories/s3/S3BlobContainer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java b/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java index 409a24679f2dd..87b3c17bfd91c 100644 --- a/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java +++ b/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobContainer.java @@ -641,7 +641,7 @@ void run(BytesReference expected, BytesReference updated, ActionListener { // Best-effort attempt to clean up after ourselves. - logger.trace(Strings.format("[%s] aborting upload [%s] on exception", blobKey, uploadId), e); + logger.trace(() -> Strings.format("[%s] aborting upload [%s] on exception", blobKey, uploadId), e); safeAbortMultipartUpload(uploadId); l.onFailure(e); })); @@ -852,6 +852,7 @@ public void compareAndExchangeRegister( ) { final var clientReference = blobStore.clientReference(); ActionListener.run(ActionListener.releaseAfter(listener.delegateResponse((delegate, e) -> { + logger.trace(() -> Strings.format("[%s]: compareAndExchangeRegister failed", key), e); if (e instanceof AmazonS3Exception amazonS3Exception && amazonS3Exception.getStatusCode() == 404) { // an uncaught 404 means that our multipart upload was aborted by a concurrent operation before we could complete it delegate.onResponse(OptionalBytesReference.MISSING); @@ -879,6 +880,7 @@ public void getRegister(OperationPurpose purpose, String key, ActionListener Strings.format("[%s]: getRegister failed", key), e); if (e.getStatusCode() == 404) { return OptionalBytesReference.EMPTY; } else {