Skip to content

Commit 37e56ff

Browse files
committed
chore(spanner): review comments
1 parent 2003ad4 commit 37e56ff

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,6 @@ public void run() {
501501
onPrecommitToken(proto.getPrecommitToken());
502502
span.addAnnotation(
503503
"Commit operation will be retried with new precommit token as the CommitResponse includes a MultiplexedSessionRetry field");
504-
opSpan.addAnnotation(
505-
"Commit operation will be retried with new precommit token as the CommitResponse includes a MultiplexedSessionRetry field");
506504
opSpan.end();
507505

508506
// Retry the commit RPC with the latest precommit token from CommitResponse.

google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,13 +1618,17 @@ public void testReadWriteTransactionWithCommitRetryProtocolExtensionSet() {
16181618
assertEquals(
16191619
ByteString.copyFromUtf8("PartialResultSetPrecommitToken"),
16201620
commitRequests.get(0).getPrecommitToken().getPrecommitToken());
1621+
// Verify that the first request has mutations set
1622+
assertTrue(commitRequests.get(0).getMutationsCount() > 0);
16211623

16221624
// Second CommitRequest should contain the latest precommit token received via the
16231625
// CommitResponse in previous attempt.
16241626
assertNotNull(commitRequests.get(1).getPrecommitToken());
16251627
assertEquals(
16261628
ByteString.copyFromUtf8("CommitResponsePrecommitToken"),
16271629
commitRequests.get(1).getPrecommitToken().getPrecommitToken());
1630+
// Verify that the commit retry request does not have any mutations set
1631+
assertEquals(0, commitRequests.get(1).getMutationsCount());
16281632

16291633
assertNotNull(client.multiplexedSessionDatabaseClient);
16301634
assertEquals(1L, client.multiplexedSessionDatabaseClient.getNumSessionsAcquired().get());

0 commit comments

Comments
 (0)