Skip to content

Commit 310c38e

Browse files
committed
Only overwrite cache first sequence when writing first index
Signed-off-by: Neil Twigg <[email protected]>
1 parent af0791b commit 310c38e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

server/.tmp

-66 Bytes
Binary file not shown.

server/filestore.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6398,11 +6398,10 @@ func (mb *msgBlock) writeMsgRecordLocked(rl, seq uint64, subj string, mhdr, msg
63986398
mb.updateAccounting(seq, ts, rl)
63996399
// Strip ebit if set.
64006400
seq = seq &^ ebit
6401-
if mb.cache.fseq == 0 {
6401+
// Write index
6402+
if mb.cache.idx = append(mb.cache.idx, uint32(index)|cbit); len(mb.cache.idx) == 1 {
64026403
mb.cache.fseq = seq
64036404
}
6404-
// Write index
6405-
mb.cache.idx = append(mb.cache.idx, uint32(index)|cbit)
64066405
} else {
64076406
// Make sure to account for tombstones in rbytes.
64086407
mb.rbytes += rl

0 commit comments

Comments
 (0)