mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
We should update accounting before clearing ebit
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -3836,6 +3836,8 @@ 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 {
|
||||
@@ -3843,8 +3845,6 @@ func (mb *msgBlock) writeMsgRecord(rl, seq uint64, subj string, mhdr, msg []byte
|
||||
}
|
||||
// Write index
|
||||
mb.cache.idx = append(mb.cache.idx, uint32(index)|hbit)
|
||||
// Accounting
|
||||
mb.updateAccounting(seq, ts, rl)
|
||||
}
|
||||
|
||||
fch, werr := mb.fch, mb.werr
|
||||
|
||||
Reference in New Issue
Block a user