Closed MauriceVanVeen closed 1 year ago
What is message 63? nats str get OBJ_bucket 63
The fix is already merged, but for completeness:
State:
Messages: 764
Bytes: 95 MiB
FirstSeq: 63 @ 2023-04-12T19:14:20 UTC
LastSeq: 1,528 @ 2023-04-12T19:14:34 UTC
Deleted Messages: 702
Active Consumers: 0
Number of Subjects: 2
:~# nats str get -a
? Select a Stream OBJ_bucket
? Message Sequence to retrieve 63
nats: error: could not retrieve OBJ_bucket#63: no message found (10037)
After purging the subject there is no message there any more, the FirstSeq was not being updated if multiple blocks were removed.
Defect
Make sure that these boxes are checked before submitting your issue -- thank you!
nats-server -DV
outputVersions of
nats-server
and affected client libraries used:nats-server 2.9.15 natsio/nats-box latest
OS/Container environment:
Using docker:
Steps or code to reproduce the issue:
Create an OBJ bucket:
nats obj add bucket --storage=file
(to demonstrate when having many messages spanning multiple message blocks)Create a file with random data:
head -c 100000000 </dev/urandom > bucket_data
Put the data into the bucket:
nats obj put bucket bucket_data -f
nats str info -a OBJ_bucket
Expected:state.FirstSeq = 1, state.LastSeq = 764, state.NumDeleted = 0
Actual: equals ^Put the data into the bucket again, to start purging previous data:
nats obj put bucket bucket_data -f
nats str info -a OBJ_bucket
Expected:state.FirstSeq = 765, state.LastSeq = 1528, state.NumDeleted = 0
Actual:state.FirstSeq = 63, state.LastSeq = 1528, state.NumDeleted = 702
Expected result:
A stream's first seq should be correct after purging from a subject.
Only occurs when using file storage, memory storage works as expected.
Actual result:
A stream's first seq stops being updated.