Skip to content

Commit d2ed8e7

Browse files
committed
Revert "Add temporary logging for elastic#125668 (elastic#125749)"
This reverts commit 8ced682.
1 parent 9314613 commit d2ed8e7

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ tests:
359359
- class: org.elasticsearch.smoketest.MlWithSecurityIT
360360
method: test {yaml=ml/data_frame_analytics_cat_apis/Test cat data frame analytics single job with header}
361361
issue: https://github.com/elastic/elasticsearch/issues/125642
362+
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.GCSRepositoryAnalysisRestIT
363+
method: testRepositoryAnalysis
364+
issue: https://github.com/elastic/elasticsearch/issues/125668
362365
- class: org.elasticsearch.packaging.test.DockerTests
363366
method: test010Install
364367
issue: https://github.com/elastic/elasticsearch/issues/125680

server/src/main/java/org/elasticsearch/common/blobstore/support/BlobContainerUtils.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@
99

1010
package org.elasticsearch.common.blobstore.support;
1111

12-
import org.apache.logging.log4j.Level;
13-
import org.apache.logging.log4j.LogManager;
14-
import org.apache.logging.log4j.Logger;
15-
import org.elasticsearch.common.ReferenceDocs;
1612
import org.elasticsearch.common.Strings;
1713
import org.elasticsearch.common.blobstore.BlobContainer;
1814
import org.elasticsearch.common.bytes.BytesArray;
1915
import org.elasticsearch.common.bytes.BytesReference;
20-
import org.elasticsearch.common.logging.ChunkedLoggingStream;
21-
import org.elasticsearch.common.unit.ByteSizeUnit;
2216

2317
import java.io.IOException;
2418
import java.io.InputStream;
@@ -38,8 +32,6 @@ public static void ensureValidRegisterContent(BytesReference bytesReference) {
3832
}
3933
}
4034

41-
private static final Logger logger = LogManager.getLogger(BlobContainerUtils.class);
42-
4335
/**
4436
* Many blob stores have consistent (linearizable/atomic) read semantics and in these casees it is safe to implement {@link
4537
* BlobContainer#getRegister} by simply reading the blob using this utility.
@@ -59,28 +51,7 @@ public static BytesReference getRegisterUsingConsistentRead(InputStream inputStr
5951
len -= read;
6052
pos += read;
6153
}
62-
final int nextByte = inputStream.read();
63-
if (nextByte != -1) {
64-
try (
65-
var cls = ChunkedLoggingStream.create(
66-
logger,
67-
Level.ERROR,
68-
"getRegisterUsingConsistentRead including trailing data",
69-
ReferenceDocs.LOGGING
70-
)
71-
) {
72-
cls.write(bytes);
73-
cls.write(nextByte);
74-
final var buffer = new byte[ByteSizeUnit.KB.toIntBytes(1)];
75-
while (true) {
76-
final var readSize = inputStream.read(buffer);
77-
if (readSize == -1) {
78-
break;
79-
}
80-
cls.write(buffer, 0, readSize);
81-
}
82-
}
83-
54+
if (inputStream.read() != -1) {
8455
throw new IllegalStateException(
8556
Strings.format("[%s] failed reading register [%s] due to unexpected trailing data", container, key)
8657
);

0 commit comments

Comments
 (0)