Skip to content

Commit

Permalink
[FIXED] We should update accounting before clearing ebit (#4473)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Sep 1, 2023
2 parents a2373d9 + 4422a95 commit f6aaea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/filestore.go
Expand Up @@ -3836,15 +3836,15 @@ func (mb *msgBlock) writeMsgRecord(rl, seq uint64, subj string, mhdr, msg []byte

// Only update index and do accounting if not a delete tombstone.
if seq&tbit == 0 {
// Accounting, do this before stripping ebit, it is ebit aware.
mb.updateAccounting(seq, ts, rl)
// Strip ebit if set.
seq = seq &^ ebit
if mb.cache.fseq == 0 {
mb.cache.fseq = seq
}
// Write index
mb.cache.idx = append(mb.cache.idx, uint32(index)|hbit)
// Accounting
mb.updateAccounting(seq, ts, rl)
}

fch, werr := mb.fch, mb.werr
Expand Down

0 comments on commit f6aaea1

Please sign in to comment.