mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Check in initial pending if our filtered subject directly matches our stream config.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2729,8 +2729,18 @@ func (o *consumer) setInitialPending() {
|
||||
if mset == nil {
|
||||
return
|
||||
}
|
||||
// Non-filtering, means we want all messages.
|
||||
if o.cfg.FilterSubject == _EMPTY_ {
|
||||
// notFiltered means we want all messages.
|
||||
notFiltered := o.cfg.FilterSubject == _EMPTY_
|
||||
if !notFiltered {
|
||||
// Check to see if we directly match the configured stream.
|
||||
// Many clients will always send a filtered subject.
|
||||
cfg := mset.config()
|
||||
if len(cfg.Subjects) == 1 && cfg.Subjects[0] == o.cfg.FilterSubject {
|
||||
notFiltered = true
|
||||
}
|
||||
}
|
||||
|
||||
if notFiltered {
|
||||
state := mset.store.State()
|
||||
if state.Msgs > 0 {
|
||||
o.sgap = state.Msgs - (o.sseq - state.FirstSeq)
|
||||
|
||||
Reference in New Issue
Block a user