-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade GCS SDK to 1.104.0 #52839
Upgrade GCS SDK to 1.104.0 #52839
Conversation
Upgrading the GCS SDK to the most recent version. Adjusting (i.e. improving) the REST mock accordingly. This should significantly boost performance by pulling in googleapis/java-core#86 in some cases.
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
@@ -331,7 +333,7 @@ public void testWriteBlobWithReadTimeouts() { | |||
|
|||
public void testWriteLargeBlob() throws IOException { | |||
// See {@link BaseWriteChannel#DEFAULT_CHUNK_SIZE} | |||
final int defaultChunkSize = 8 * 256 * 1024; | |||
final int defaultChunkSize = 60 * 256 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got way increased in googleapis/java-core#86 :)
@@ -199,6 +199,8 @@ StorageOptions createStorageOptions(final GoogleCloudStorageClientSettings clien | |||
final HttpTransportOptions httpTransportOptions) { | |||
StorageOptions options = super.createStorageOptions(clientSettings, httpTransportOptions); | |||
return options.toBuilder() | |||
.setHost(options.getHost()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason the toBuilder
keeps track of all settings but these two in the latest version so we have to manually set these again.
@@ -266,7 +268,7 @@ protected String requestUniqueId(HttpExchange exchange) { | |||
} | |||
|
|||
final String range = exchange.getRequestHeaders().getFirst("Content-Range"); | |||
return exchange.getRemoteAddress().toString() | |||
return exchange.getRemoteAddress().getHostString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a behavior change with retries here. The retries are now executed across multiple different TCP connections instead of reusing the same connection. This means we can't key them by the full address including the port any longer because that would allow for more retries than we assume.
// removes the trailing end "\r\n--__END_OF_PART__--\r\n" which is 23 bytes long | ||
int len = fullRequestBody.length() - startPos - 23; | ||
content = Tuple.tuple(name, fullRequestBody.slice(startPos, len)); | ||
while (isEndOfPart(fullRequestBody, endPos) == false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new SDK isn't just sending END_OF_PART${uuid} so this needed to become a little smarter.
See related SDK code https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/src/main/java/com/google/api/client/http/MultipartContent.java#L35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks Tanguy! |
Upgrading the GCS SDK to the most recent version. Adjusting (i.e. improving) the REST mock accordingly. This should significantly boost performance by pulling in googleapis/java-core#86 in some cases.
Upgrading the GCS SDK to the most recent version. Adjusting (i.e. improving) the REST mock accordingly. This should significantly boost performance by pulling in googleapis/java-core#86 in some cases.
Upgrading the GCS SDK to the most recent version.
Adjusting (i.e. improving and bringing it closer to the real thing) the REST mock accordingly.
This should significantly boost performance by pulling in
googleapis/java-core#86 in some cases.