Skip to content

Commit 4d2ad34

Browse files
authored
Merge pull request #372 from Eistern/bugfix/fix-write-in-tx-case
Handle write acks from YDB server during transactions
2 parents f88379f + 7edfa99 commit 4d2ad34

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<properties>
1717
<ydb-auth-api.version>1.0.0</ydb-auth-api.version>
18-
<ydb-proto-api.version>1.6.4</ydb-proto-api.version>
18+
<ydb-proto-api.version>1.7.0</ydb-proto-api.version>
1919
<yc-auth.version>2.2.0</yc-auth.version>
2020
</properties>
2121

topic/src/main/java/tech/ydb/topic/write/WriteAck.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public WriteAck(long seqNo, State state, Details details) {
1616

1717
public enum State {
1818
WRITTEN,
19-
ALREADY_WRITTEN
19+
ALREADY_WRITTEN,
20+
WRITTEN_IN_TX
2021
}
2122

2223
public static class Details {

topic/src/main/java/tech/ydb/topic/write/impl/WriterImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ private void processWriteAck(EnqueuedMessage message,
516516
return;
517517
}
518518
break;
519-
519+
case WRITTEN_IN_TX:
520+
resultAck = new WriteAck(ack.getSeqNo(), WriteAck.State.WRITTEN_IN_TX, null);
521+
break;
520522
default:
521523
message.getFuture().completeExceptionally(
522524
new RuntimeException("Unknown WriteAck state"));

0 commit comments

Comments
 (0)