mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-15 02:30:40 -07:00
Off by one bug (surprise) that would skip first new message on deliver last per subject.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2659,7 +2659,7 @@ func (o *consumer) selectStartingSeqNo() {
|
||||
} else if o.cfg.DeliverPolicy == DeliverLastPerSubject {
|
||||
if mss := o.mset.store.SubjectsState(o.cfg.FilterSubject); len(mss) > 0 {
|
||||
o.lss = &lastSeqSkipList{
|
||||
resume: stats.LastSeq + 1,
|
||||
resume: stats.LastSeq,
|
||||
seqs: createLastSeqSkipList(mss),
|
||||
}
|
||||
o.sseq = o.lss.seqs[0]
|
||||
|
||||
@@ -12302,11 +12302,11 @@ func TestJetStreamDeliverLastPerSubject(t *testing.T) {
|
||||
checkNext("kv.b1.baz", 65, "11")
|
||||
|
||||
msg := []byte(fmt.Sprintf("%d", 22))
|
||||
js.Publish("kv.b2.foo", msg) // Not filtered through..
|
||||
js.Publish("kv.b1.bar", msg)
|
||||
js.Publish("kv.b2.foo", msg) // Not filtered through..
|
||||
|
||||
checkSubsPending(t, sub, 1)
|
||||
checkNext("kv.b1.bar", 68, "22")
|
||||
checkNext("kv.b1.bar", 67, "22")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user