Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broker: tear down and restart a demoted replica #415

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

jgraettinger
Copy link
Contributor

@jgraettinger jgraettinger commented Jan 17, 2025

Second attempt at making sure pipelines are released in this scenario.

Under this approach, we cancel the whole replica and build a new one, relying on the existing replica cancellation and shutdown behavior.


This change is Reviewable

@jgraettinger jgraettinger requested a review from psFried January 17, 2025 02:17
It's possible for a broker to transition from primary => replica, if it
doesn't happen to observe a keyspace update where it's assignment is
removed prior to it being re-added by the allocator.

If we were the primary, we need to be sure to tear down the replication
pipeline we may be holding. Handle this scenario by cancelling the
current replica and building a new one.

Also add a (hopefully) temporary work-around for the multiple assignment
issue we're currently tracking down.
@jgraettinger jgraettinger force-pushed the johnny/release-pipeline branch from e0f2f4a to 8d8fa04 Compare January 17, 2025 03:21
It was previously possible for some Etcd transactions to be applied
by Checkpoint within a converge() call, and for a failure to then cause
converge() to bubble up an error, which could result in not reading
through the preceeding successful transactions before continuing.

Refactor checkpointTxn to retain the last successful transaction
revision, and ensure we read through this revision regardless of whether
the converge fully completed or failed along the way.
Copy link
Contributor

@psFried psFried left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

broker/resolver.go Show resolved Hide resolved
@jgraettinger jgraettinger merged commit da22df6 into master Jan 17, 2025
1 check passed
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