Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ tests:
- class: org.elasticsearch.smoketest.MlWithSecurityIT
method: test {yaml=ml/data_frame_analytics_cat_apis/Test cat data frame analytics single job with header}
issue: https://github.com/elastic/elasticsearch/issues/125642
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.GCSRepositoryAnalysisRestIT
method: testRepositoryAnalysis
issue: https://github.com/elastic/elasticsearch/issues/125668
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to un-mute this anyway, any objection if we don't revert this bit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

Copy link
Member

@ywangd ywangd Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my comment maybe ambiguous. I meant it's ok to not revert since this is a much simpler revert.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errr it got muted again 51ed156 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I haven't got the client revert through the pipeline yet. I probably should have done them in the opposite order (client then logging).

- class: org.elasticsearch.packaging.test.DockerTests
method: test010Install
issue: https://github.com/elastic/elasticsearch/issues/125680
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@

package org.elasticsearch.common.blobstore.support;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.common.ReferenceDocs;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.blobstore.BlobContainer;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.logging.ChunkedLoggingStream;
import org.elasticsearch.common.unit.ByteSizeUnit;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -38,8 +32,6 @@ public static void ensureValidRegisterContent(BytesReference bytesReference) {
}
}

private static final Logger logger = LogManager.getLogger(BlobContainerUtils.class);

/**
* Many blob stores have consistent (linearizable/atomic) read semantics and in these casees it is safe to implement {@link
* BlobContainer#getRegister} by simply reading the blob using this utility.
Expand All @@ -59,28 +51,7 @@ public static BytesReference getRegisterUsingConsistentRead(InputStream inputStr
len -= read;
pos += read;
}
final int nextByte = inputStream.read();
if (nextByte != -1) {
try (
var cls = ChunkedLoggingStream.create(
logger,
Level.ERROR,
"getRegisterUsingConsistentRead including trailing data",
ReferenceDocs.LOGGING
)
) {
cls.write(bytes);
cls.write(nextByte);
final var buffer = new byte[ByteSizeUnit.KB.toIntBytes(1)];
while (true) {
final var readSize = inputStream.read(buffer);
if (readSize == -1) {
break;
}
cls.write(buffer, 0, readSize);
}
}

if (inputStream.read() != -1) {
throw new IllegalStateException(
Strings.format("[%s] failed reading register [%s] due to unexpected trailing data", container, key)
);
Expand Down