Repository navigation
fix(state): roll back refused worker frontend orders - #1886
Merged
Merged
Conversation
Signed-off-by: Florentin Dubois <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The worker writes a request to its
ConfigStatebefore applying it to the live proxy. A frontend or listener addition, or a frontend removal, that the proxy then refuses could therefore remain in the worker state even though it never reached the runtime. The main process rolls back an all-worker refusal, soQueryClusterByIdcould subsequently report a main/worker disagreement.This change shares the request-only inverses between the main process and workers, snapshots the exact stored frontend before removals, and applies the compensating request on a worker runtime refusal. Rollback is armed only after the original state dispatch succeeds, so a rejected duplicate cannot erase a pre-existing object.
The scope is deliberately bounded. Upserts, listener updates, cluster removals, and certificate mutations still require distinct displaced-value or runtime snapshots. HTTP/HTTPS changes across several same-address listeners can also leave a pre-existing heterogeneous runtime partially changed if one listener refuses; this change restores
ConfigState, not that runtime-only state.Validation:
cargo +nightly fmt --all -- --checkcargo clippy --all-targets --locked -- -D warningscargo build --all-features --lockedcargo test --workspace --locked