Skip to content

Commit

Permalink
Re-order condition in decStreamPending (#6300)
Browse files Browse the repository at this point in the history
Makes the change suggested in
#6297 (comment)

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
  • Loading branch information
derekcollison authored Dec 24, 2024
2 parents c4b778c + c13c36c commit 0ae722e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5847,7 +5847,7 @@ func (o *consumer) decStreamPending(sseq uint64, subj string) {
// Either we have not reached the message yet, or we've hit the race condition
// when there is contention at the beginning of the stream. In which case we can
// only decrement if the ack floor is still low enough to be able to detect it.
if o.isFilteredMatch(subj) && sseq > o.asflr && (sseq >= o.sseq || !wasPending) {
if sseq > o.asflr && (sseq >= o.sseq || !wasPending) && o.isFilteredMatch(subj) {
o.npc--
}

Expand Down

0 comments on commit 0ae722e

Please sign in to comment.