Merge pull request #2104 from nats-io/pbug2

Make sure we do not set last to -1
This commit is contained in:
Derek Collison
2021-04-12 11:19:09 -07:00
committed by GitHub

View File

@@ -617,7 +617,7 @@ func (mb *msgBlock) rebuildState() (*LostStreamData, error) {
}
// For empty msg blocks make sure we recover last seq correctly based off of first.
if mb.msgs == 0 {
if mb.msgs == 0 && mb.first.seq > 0 {
mb.last.seq = mb.first.seq - 1
}