The call to js.processStreamAssignment(sa) even while we're recovering would mean that on meta recovery we'd first create the file-based stream, then create the memory-based stream and fail to do so since we can't change storage types. Which then leaves us stranded with 2 nodes having a memory-based stream, and that one node with a file-based stream.
This change proposes to have the stream additions be consistent with the other collecting of state into ru *recoveryUpdates before applying, and waiting until recovery is finished to do so.
For the following scenario:
The call to
js.processStreamAssignment(sa)
even while we're recovering would mean that on meta recovery we'd first create the file-based stream, then create the memory-based stream and fail to do so since we can't change storage types. Which then leaves us stranded with 2 nodes having a memory-based stream, and that one node with a file-based stream.This change proposes to have the stream additions be consistent with the other collecting of state into
ru *recoveryUpdates
before applying, and waiting until recovery is finished to do so.Signed-off-by: Maurice van Veen github@mauricevanveen.com Co-authored-by: Neil Twigg neil@nats.io