Skip to content

Commit

Permalink
Merge pull request #1808 from nats-io/maurice/ordered-invalid-sub
Browse files Browse the repository at this point in the history
[FIXED] Invalid subscription on ordered consumer in leaderless cluster
  • Loading branch information
wallyqs authored Feb 24, 2025
2 parents 4ba1afe + 836ffd9 commit da7160e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js.go
Original file line number Diff line number Diff line change
Expand Up @@ -2206,6 +2206,9 @@ func (sub *Subscription) resetOrderedConsumer(sseq uint64) {
// retry for insufficient resources, as it may mean that client is connected to a running
// server in cluster while the server hosting R1 JetStream resources is restarting
return
} else if errors.As(err, &apiErr) && apiErr.ErrorCode == JSErrCodeJetStreamNotAvailable {
// retry if JetStream meta leader is temporarily unavailable
return
}
pushErr(err)
return
Expand Down
1 change: 1 addition & 0 deletions jserrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const (
JSErrCodeJetStreamNotEnabledForAccount ErrorCode = 10039
JSErrCodeJetStreamNotEnabled ErrorCode = 10076
JSErrCodeInsufficientResourcesErr ErrorCode = 10023
JSErrCodeJetStreamNotAvailable ErrorCode = 10008

JSErrCodeStreamNotFound ErrorCode = 10059
JSErrCodeStreamNameInUse ErrorCode = 10058
Expand Down

0 comments on commit da7160e

Please sign in to comment.