diff --git a/server/const.go b/server/const.go index 41afb267..d9d3d40f 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.10.0-beta" + VERSION = "2.10.0-beta.1" // PROTO is the currently supported protocol. // 0 was the original diff --git a/server/filestore.go b/server/filestore.go index 9d68997c..782268c6 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -6233,6 +6233,9 @@ func (o *consumerFileStore) UpdateConfig(cfg *ConsumerConfig) error { } func (o *consumerFileStore) Update(state *ConsumerState) error { + o.mu.Lock() + defer o.mu.Unlock() + // Sanity checks. if state.AckFloor.Consumer > state.Delivered.Consumer { return fmt.Errorf("bad ack floor for consumer") @@ -6262,12 +6265,8 @@ func (o *consumerFileStore) Update(state *ConsumerState) error { } } - // Replace our state. - o.mu.Lock() - // Check to see if this is an outdated update. if state.Delivered.Consumer < o.state.Delivered.Consumer { - o.mu.Unlock() return fmt.Errorf("old update ignored") } @@ -6276,7 +6275,6 @@ func (o *consumerFileStore) Update(state *ConsumerState) error { o.state.Pending = pending o.state.Redelivered = redelivered o.kickFlusher() - o.mu.Unlock() return nil }