nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

Group metalayer consumer assignments by stream during recovery #6066

Closed neilalexander closed 2 weeks ago

neilalexander commented 2 weeks ago

This updates the metalayer recovery so that consumer assignments are grouped by the stream recovery key, such that a stream removal can also clean up any pending consumer updates.

Previously, if the metalayer recovered the following:

  1. Stream update assignment
  2. Consumer update assignment
  3. Stream remove assignment
  4. Stream update assignment

... then 2 would survive the recovery process because 4 cancelled out 3 and 3 didn't cancel out 2.

Signed-off-by: Neil Twigg neil@nats.io Co-authored-by: Maurice van Veen github@mauricevanveen.com