mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Optimize consumer messages sequences for multiple subjects
If consumer with multiple subjects encountered a sequnece of messages from the same subject, it tried to load messages from other subjects in some cases. This checks for that scenario and optimizes it by early returning. Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
This commit is contained in:
@@ -3295,6 +3295,11 @@ func (o *consumer) getNextMsg() (*jsPubMsg, uint64, error) {
|
||||
o.updateSkipped(uint64(filter.currentSeq))
|
||||
}
|
||||
}
|
||||
|
||||
// If we're sure that this filter has continuous sequence of messages, skip looking up other filters.
|
||||
if nextSeq == sseq && err != ErrStoreEOF {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user