Skip to content

Commit 736371b

Browse files
committed
Fix off-by-one in tail scan when indexing blocks
Signed-off-by: Neil Twigg <[email protected]>
1 parent 48a4477 commit 736371b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/.tmp

66 Bytes
Binary file not shown.

server/filestore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7143,8 +7143,8 @@ func (mb *msgBlock) indexCacheBuf(buf []byte) error {
71437143
// earlier loop if we've ran out of block file to look at, but should
71447144
// be easily noticed because the seq will be below the last seq from
71457145
// the index.
7146-
if seq > 0 && seq < mbLastSeq {
7147-
for dseq := seq; dseq < mbLastSeq; dseq++ {
7146+
if seq > 0 && seq+1 <= mbLastSeq {
7147+
for dseq := seq + 1; dseq <= mbLastSeq; dseq++ {
71487148
idx = append(idx, dbit)
71497149
if dms == 0 {
71507150
mb.dmap.Insert(dseq)

0 commit comments

Comments
 (0)