Skip to content

Comments

[FIXED] Race condition when remapping group#7820

Merged
neilalexander merged 1 commit intomainfrom
maurice/remove-node-race
Feb 13, 2026
Merged

[FIXED] Race condition when remapping group#7820
neilalexander merged 1 commit intomainfrom
maurice/remove-node-race

Conversation

@MauriceVanVeen
Copy link
Member

When remapping the Raft group we need not only remove the current node, we also need to wait for the current monitor goroutine to exit. Otherwise we might open a new monitor goroutine too soon such that it exits as the other is still active before it shuts down.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner February 12, 2026 22:10
wallyqs pushed a commit to wallyqs/nats-server that referenced this pull request Feb 12, 2026
Reviewed the fix for a race condition in processClusterUpdateStream()
where removeNode() was called without waiting for the monitor goroutine
to fully exit, potentially leaving streams unmonitored after remapping
or causing data races during R1 downgrade.

https://claude.ai/code/session_01Y8dPryfpBsiWPaJwPssGR8
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neilalexander neilalexander merged commit 59c6333 into main Feb 13, 2026
69 of 70 checks passed
@neilalexander neilalexander deleted the maurice/remove-node-race branch February 13, 2026 10:11
neilalexander added a commit that referenced this pull request Feb 16, 2026
Includes the following:

- #7780
- #7784
- #7782
- #7783
- #7787
- #7789
- #7793
- #7797
- #7798
- #7799
- #7790
- #7805
- #7810
- #7811
- #7812
- #7809
- #7724
- #7815
- #7816
- #7818
- #7819
- #7820
- #7795
- #7825
- #7828
- #7835
- #7837

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants