-
Notifications
You must be signed in to change notification settings - Fork 132
chore(x-goog-spanner-request-id): plumb for BatchCreateSessions #3815
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
chore(x-goog-spanner-request-id): plumb for BatchCreateSessions #3815
Conversation
b9e9734
to
f4c6768
Compare
f4c6768
to
ecb64c7
Compare
@sakthivelmanii @olavloite @rahul2393 @surbhigarg92 kindly help me run the bots here. Thank you. |
4bdb739
to
e7463fb
Compare
google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionClient.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java
Outdated
Show resolved
Hide resolved
@@ -435,14 +466,18 @@ public AsyncTransactionManagerImpl transactionManagerAsync(TransactionOption... | |||
|
|||
@Override | |||
public ApiFuture<Empty> asyncClose() { | |||
return spanner.getRpc().asyncDeleteSession(getName(), getOptions()); | |||
XGoogSpannerRequestId reqId = | |||
this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); |
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.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); | |
this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 1); |
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.
I manually have been increasing attempts for it. Let's get this merged in as is and in the next round I shall get them all fixed up.
} | ||
|
||
@Override | ||
public void close() { | ||
ISpan span = tracer.spanBuilder(SpannerImpl.DELETE_SESSION); | ||
try (IScope s = tracer.withSpan(span)) { | ||
spanner.getRpc().deleteSession(getName(), getOptions()); | ||
XGoogSpannerRequestId reqId = | ||
this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); |
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.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0); | |
this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 1); |
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.
I manually have been increasing attempts for it. Let's get this merged in as is and in the next round I shall get them all fixed up.
google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
Outdated
Show resolved
Hide resolved
cd1af14
to
8c48dec
Compare
39fdba9
to
9484419
Compare
9484419
to
d08e24c
Compare
This change plumbs x-goog-spanner-request-id into BatchCreateSessions and asserts that the header is present for that method. Updates googleapis#3537
This change plumbs x-goog-spanner-request-id into BatchCreateSessions and asserts that the header is present for that method. Updates googleapis#3537
More updates DatabaseClientImpl.runWithSessionRetry update on ID Move reqId attempt increase out of runWithRetries Apply allOptions copy everywhere Complete testrunWithSessionRetry_withRequestId
9608560
to
591ab72
Compare
public int hashCode() { | ||
return RequestIdOption.class.hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
return o instanceof RequestIdOption; | ||
} |
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.
Regarding #3815 (comment)
LastStatementOption
does not contain any state, and hence the hashCode
and equals
methods just returns the hash code of the class / checks if the other object is also an instance of the same class.
This option does contain state, and the hashCode and equals methods should use that state to calculate a hash value and check equality. Let's fix that in a follow-up PR.
This change plumbs x-goog-spanner-request-id into BatchCreateSessions and asserts that the header is present for that method.
Updates #3537