Skip to content

Commit 879358e

Browse files
committed
return ErrCommitToExpiredSession for commit to stopped partitions
1 parent 3a7fe1c commit 879358e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fixed return private error for commit to stopped partition in topic reader.
12
* Stopped wrapping err error as transport error at topic streams (internals)
23

34
## v3.56.1

internal/topic/topicreaderinternal/stream_reader_impl.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import (
2525
var (
2626
PublicErrCommitSessionToExpiredSession = xerrors.Wrap(errors.New("ydb: commit to expired session"))
2727

28-
errPartitionSessionStoppedByServer = xerrors.Wrap(errors.New("ydb: topic partition session stopped by server"))
29-
errCommitWithNilPartitionSession = xerrors.Wrap(errors.New("ydb: commit with nil partition session"))
28+
errCommitWithNilPartitionSession = xerrors.Wrap(errors.New("ydb: commit with nil partition session"))
3029
)
3130

3231
type partitionSessionID = rawtopicreader.PartitionSessionID
@@ -385,7 +384,7 @@ func (r *topicStreamReaderImpl) checkCommitRange(commitRange commitRange) error
385384
}
386385

387386
if session.Context().Err() != nil {
388-
return xerrors.WithStackTrace(fmt.Errorf("ydb: commit error: %w", errPartitionSessionStoppedByServer))
387+
return xerrors.WithStackTrace(PublicErrCommitSessionToExpiredSession)
389388
}
390389

391390
ownSession, err := r.sessionController.Get(session.partitionSessionID)

0 commit comments

Comments
 (0)