Skip to content

[FIXED] Peer removal race#6316

Merged
derekcollison merged 1 commit intomainfrom
maurice/peers-race
Jan 2, 2025
Merged

[FIXED] Peer removal race#6316
derekcollison merged 1 commit intomainfrom
maurice/peers-race

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

There was a race with keeping peers up-to-date. When updating replicas of a stream up and down rapidly enough the peer state could desync since the update is handled by the meta layer, but the peer removal is handled by the stream. If the meta layer agreed on scaling the stream up to 5 replicas, but a peer removal came in after from an earlier downscale, then a server would end up with an incomplete peer list.

Since peer changes are done by the meta layer we can/should trust that does the right thing, and we don't need to fiddle by proposing peer removals ourselves.

Also, since the meta layer handles stream creates/updates and calls into UpdateKnownPeers already, we shouldn't then propose the peers (again) through the stream layer.

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 January 2, 2025 14:28
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 2dc32c1 into main Jan 2, 2025
@derekcollison derekcollison deleted the maurice/peers-race branch January 2, 2025 23:26
wallyqs added a commit that referenced this pull request Jan 9, 2025
#### Dependencies
- #6323
- #6324

####  Leafnode
- #6291

#### JetStream
- #6226
- #6235
- #6277
- #6279
- #6283
- #6289
- #6316
- #6317
- #6325
- #6326
- #6335
- #6338
- #6341
- #6344
- #6150
- #6351
- #6355

#### Tests
- #6278
- #6297
- #6300
- #6343
- #6329
- #6330
- #6331
- #6332
- #6334
- #6356
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.

2 participants