Fix bug that would race around check for last sequence per subject

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-07-18 11:29:59 -07:00
parent efbfe217f4
commit e1a00a883c

View File

@@ -3861,7 +3861,7 @@ func (mset *stream) processJetStreamMsg(subject, reply string, hdr, msg []byte,
}
// Expected last sequence per subject.
// If we are clustered we have prechecked seq > 0.
if seq, exists := getExpectedLastSeqPerSubject(hdr); exists && (!isClustered || seq == 0) {
if seq, exists := getExpectedLastSeqPerSubject(hdr); exists {
// TODO(dlc) - We could make a new store func that does this all in one.
var smv StoreMsg
var fseq uint64