nats-io / stan.go

NATS Streaming System
https://nats.io
Apache License 2.0
706 stars 117 forks source link

sequence. asked vs actual #306

Closed biskit closed 4 years ago

biskit commented 4 years ago

Hi, versions:

stan: 0.6.0
streaming: 0.16.2
storage: file
clustered: no

I'm restarting a process where it subscribes to a queue with starting sequence number. I get this in log:

[26477] 2020/02/04 18:55:57.495884 [DBG] STREAM: [Client:d53522c7ba7c411a97f1c98bab568aec_8161] Started new subscription, subject=ccc_1, inbox=_INBOX.su23PhyAtQl3niOuSuONS8, subid=3, sending from sequence, asked_seq=17 actual_seq=75
[26477] 2020/02/04 18:55:57.529452 [DBG] STREAM: [Client:d53522c7ba7c411a97f1c98bab568aec_8161] Started new subscription, subject=bbb_1, inbox=_INBOX.su23PhyAtQl3niOuSuONUK, subid=3, sending from sequence, asked_seq=1545 actual_seq=15215
[26477] 2020/02/04 18:55:57.573993 [DBG] STREAM: [Client:d53522c7ba7c411a97f1c98bab568aec_8161] Started new subscription, subject=aaa_1, inbox=_INBOX.su23PhyAtQl3niOuSuONWW, subid=3, sending from sequence, asked_seq=26 actual_seq=725

here are my channel limits:

[26477] 2020/02/04 17:06:17.780039 [INF] STREAM: ---------- Store Limits ----------
[26477] 2020/02/04 17:06:17.780046 [INF] STREAM: Channels:                10000
[26477] 2020/02/04 17:06:17.780050 [INF] STREAM: --------- Channels Limits --------
[26477] 2020/02/04 17:06:17.780054 [INF] STREAM:   Subscriptions:          1000 *
[26477] 2020/02/04 17:06:17.780061 [INF] STREAM:   Messages     :       1000000 *
[26477] 2020/02/04 17:06:17.780064 [INF] STREAM:   Bytes        :     976.56 MB *
[26477] 2020/02/04 17:06:17.780068 [INF] STREAM:   Age          :        1h0m0s
[26477] 2020/02/04 17:06:17.780071 [INF] STREAM:   Inactivity   :     unlimited *
[26477] 2020/02/04 17:06:17.780075 [INF] STREAM: -------- List of Channels --------

Per #302 if its in storage I should be able to start from my requested sequence number, correct?

Thanks,

kozlovic commented 4 years ago

I see that you have set an age limit, so my guess is that some of the messages have expired and no longer available. This is why although your application ask for a start sequence of say 17, the first available on that channel may be 75 (at the time the subscription is created), hence the trace statement.

biskit commented 4 years ago

Ahh! Missed that fact. That sounds right and I'll try it.