nats-server icon indicating copy to clipboard operation
nats-server copied to clipboard

nats s view select topic T98 instead T03

Open perestoronin opened this issue 1 year ago • 9 comments

Defect

Versions of nats-server and affected client libraries used:

nats-server version 2.9.0

Steps or code to reproduce the issue:

nats s view WAREHOUSE --context=stage_leaf --subject="WAREHOUSE.documents.T03" --since=4h

Expected result:

Only selected subject="WAREHOUSE.documents.T03

Actual result:

subject="WAREHOUSE.documents.T98

IMG_20220921_175752_334__01__01__01.jpg

perestoronin avatar Sep 21 '22 14:09 perestoronin

Could you share nats stream info for the stream?

derekcollison avatar Sep 21 '22 14:09 derekcollison

Could you share nats stream info for the stream?

nats s info WAREHOUSE Information for Stream WAREHOUSE created 2022-03-29T14:16:10+03:00

Configuration:

         Subjects: WAREHOUSE.>
 Acknowledgements: true
        Retention: File - Limits
         Replicas: 1
   Discard Policy: Old
 Duplicate Window: 2m0s
Allows Msg Delete: true
     Allows Purge: true
   Allows Rollups: false
 Maximum Messages: unlimited
    Maximum Bytes: unlimited
      Maximum Age: unlimited

Maximum Message Size: unlimited Maximum Consumers: unlimited

State:

         Messages: 4,956,765
            Bytes: 5.6 GiB
         FirstSeq: 1 @ 2022-03-29T12:57:02 UTC
          LastSeq: 4,956,765 @ 2022-09-21T14:59:19 UTC
 Active Consumers: 364

perestoronin avatar Sep 21 '22 15:09 perestoronin

Thanks, do you do any server restarts? Does ever NATS cli consumer that you create deliver incorrect messages if asked to be filtered or just some? Any timing specifics that might be helpful?

derekcollison avatar Sep 21 '22 17:09 derekcollison

I am trying to reproduce, same topic name and subjects spaced filled with same amount of messages and random payload up to 1Kb and then creating a durable pull consumer and pulling on a specific subject and check that subject is correct. So far not able to reproduce. Going now to loop over all subjects and will report back.

kozlovic avatar Sep 21 '22 17:09 kozlovic

I have been checking the 100 subjects that I have (WAREHOUSE.documents.T00 to WAREHOUSE.documents.T99) randomly, and the test passes. I am running from main branch, so will now try from actual v2.9.0 release to see if it makes a difference.

kozlovic avatar Sep 21 '22 17:09 kozlovic

I have only seen this on streams that existed on the earlier version. Clustered and stand-alone. But can’t get a easy repro

ripienaar avatar Sep 21 '22 17:09 ripienaar

@perestoronin was the stream created on a NATS server version < 2.9.0?

derekcollison avatar Sep 21 '22 17:09 derekcollison

I have used 2.8.4 to generate the data, then run test to consume (randomly) from all subjects (in both the original version and v2.9.0), and so far no issue. Staring that the code at the moment...

kozlovic avatar Sep 21 '22 19:09 kozlovic

@perestoronin was the stream created on a NATS server version < 2.9.0?

Yes, stream created in version 2.8.1 or 2.8.2, or more old ...

perestoronin avatar Sep 21 '22 19:09 perestoronin

If the server is restarted again does the problem persist.

derekcollison avatar Sep 22 '22 03:09 derekcollison

We think we now understand the issue. PR coming, thanks.

derekcollison avatar Sep 22 '22 11:09 derekcollison

We think this is addressed with PR #3486.

kozlovic avatar Sep 22 '22 15:09 kozlovic