Skip to content

Commit f20d1b3

Browse files
1NepuNep1Viktor Pentyukhov
andauthored
Bugfix: error handling in internaltopicreader.addOnTransactionCompletedHandler is invalid (#1863)
Co-authored-by: Viktor Pentyukhov <nepunep@172.28.98.114-red.dhcp.yndx.net>
1 parent 5576b69 commit f20d1b3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fixed error handling in internaltopicreader.addOnTransactionCompletedHandler
2+
13
## v3.116.3
24
* Default grpc message size adjusted to the server's defaults
35

internal/topic/topicreaderinternal/stream_reader_impl.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (r *topicStreamReaderImpl) commitWithTransaction(
255255
return err
256256
})
257257
if updateOffsetInTransactionErr == nil {
258-
r.addOnTransactionCompletedHandler(ctx, tx, batch, updateOffsetInTransactionErr)
258+
r.addOnTransactionCompletedHandler(ctx, tx, batch)
259259
} else {
260260
_ = retry.Retry(ctx, func(ctx context.Context) (err error) {
261261
defer func() {
@@ -287,7 +287,6 @@ func (r *topicStreamReaderImpl) addOnTransactionCompletedHandler(
287287
ctx context.Context,
288288
tx tx.Transaction,
289289
batch *topicreadercommon.PublicBatch,
290-
updateOffesetInTransactionErr error,
291290
) {
292291
commitRange := topicreadercommon.GetCommitRange(batch)
293292
tx.OnCompleted(func(transactionResult error) {
@@ -308,7 +307,7 @@ func (r *topicStreamReaderImpl) addOnTransactionCompletedHandler(
308307
topicreadercommon.BatchGetPartitionSession(batch).SetCommittedOffsetForward(commitRange.CommitOffsetEnd)
309308
} else {
310309
_ = r.CloseWithError(xcontext.ValueOnly(ctx), xerrors.WithStackTrace(xerrors.Retryable(
311-
fmt.Errorf("ydb: failed batch commit because transaction doesn't committed: %w", updateOffesetInTransactionErr),
310+
fmt.Errorf("ydb: failed batch commit because transaction doesn't committed: %w", transactionResult),
312311
)))
313312
}
314313
})

0 commit comments

Comments
 (0)