Skip to content

Commit

Permalink
Some users reporting checksums don't match and "no message cache" on …
Browse files Browse the repository at this point in the history
…recovery.

Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Mar 4, 2022
1 parent 1b5f651 commit b759ff4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ func newFileStoreWithCreated(fcfg FileStoreConfig, cfg StreamConfig, created tim
// Always track per subject information.
fs.tms = true

// Recover our message state.
if err := fs.recoverMsgs(); err != nil {
return nil, err
}

// Write our meta data iff does not exist.
meta := path.Join(fcfg.StoreDir, JetStreamMetaFile)
if _, err := os.Stat(meta); err != nil && os.IsNotExist(err) {
Expand All @@ -323,11 +328,6 @@ func newFileStoreWithCreated(fcfg FileStoreConfig, cfg StreamConfig, created tim
}
}

// Recover our message state.
if err := fs.recoverMsgs(); err != nil {
return nil, err
}

// If we expect to be encrypted check that what we are restoring is not plaintext.
// This can happen on snapshot restores or conversions.
if fs.prf != nil {
Expand Down Expand Up @@ -4430,6 +4430,9 @@ func (mb *msgBlock) generatePerSubjectInfo() error {
if err == ErrStoreMsgNotFound || err == errDeletedMsg {
continue
}
if err == errNoCache {
return nil
}
return err
}
if sm != nil && len(sm.subj) > 0 {
Expand Down

0 comments on commit b759ff4

Please sign in to comment.