From c13c36cb5d1782f0ccd5effb4940c378ae5bb023 Mon Sep 17 00:00:00 2001 From: Maurice van Veen Date: Tue, 24 Dec 2024 09:57:37 +0100 Subject: [PATCH] Re-order condition in decStreamPending Signed-off-by: Maurice van Veen --- server/consumer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/consumer.go b/server/consumer.go index db1743cb17..6ce4678b12 100644 --- a/server/consumer.go +++ b/server/consumer.go @@ -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-- }