mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Handle skip msgs better, do not update mb stats, clear erased bit
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1596,8 +1596,6 @@ func (mb *msgBlock) skipMsg(seq uint64, now time.Time) {
|
||||
mb.dmap = make(map[uint64]struct{})
|
||||
}
|
||||
mb.dmap[seq] = struct{}{}
|
||||
mb.msgs--
|
||||
mb.bytes -= emptyRecordLen
|
||||
}
|
||||
mb.mu.Unlock()
|
||||
|
||||
@@ -1953,6 +1951,7 @@ func (mb *msgBlock) compact() {
|
||||
}
|
||||
// Always set last.
|
||||
mb.last.seq = seq &^ ebit
|
||||
|
||||
// Advance to next record.
|
||||
index += rl
|
||||
}
|
||||
@@ -2605,7 +2604,7 @@ func (mb *msgBlock) writeMsgRecord(rl, seq uint64, subj string, mhdr, msg []byte
|
||||
writeIndex := ts-mb.lwits > int64(2*time.Second)
|
||||
|
||||
// Accounting
|
||||
mb.updateAccounting(seq, ts, rl)
|
||||
mb.updateAccounting(seq&^ebit, ts, rl)
|
||||
|
||||
// Check if we are tracking per subject for our simple state.
|
||||
if len(subj) > 0 && mb.fss != nil {
|
||||
@@ -3840,6 +3839,7 @@ func (fs *fileStore) purge(fseq uint64) (uint64, error) {
|
||||
}
|
||||
fs.lmb.first.seq = fs.state.FirstSeq
|
||||
fs.lmb.last.seq = fs.state.LastSeq
|
||||
|
||||
fs.lmb.writeIndexInfo()
|
||||
|
||||
cb := fs.scb
|
||||
|
||||
Reference in New Issue
Block a user