mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 03:24:40 -07:00
During recovery check our guess on the last block.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -981,6 +981,12 @@ func (fs *fileStore) recoverMsgs() error {
|
||||
if len(fs.blks) > 0 {
|
||||
sort.Slice(fs.blks, func(i, j int) bool { return fs.blks[i].index < fs.blks[j].index })
|
||||
fs.lmb = fs.blks[len(fs.blks)-1]
|
||||
// Update our sfilter for the last block since we could have only see one subject during recovery.
|
||||
if len(fs.cfg.Subjects) == 1 {
|
||||
fs.lmb.sfilter = fs.cfg.Subjects[0]
|
||||
} else {
|
||||
fs.lmb.sfilter = _EMPTY_
|
||||
}
|
||||
} else {
|
||||
_, err = fs.newMsgBlockForWrite()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user