fix(network): reconcile eRPC overlay replacements - #815
Draft
bussyjd wants to merge 1 commit into
Draft
Conversation
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.
Summary
erpc resetcannot clean the live ConfigMapProblem
obol network erpc setreplaced the host-side overlay file but only merged the new document into the existing eRPC ConfigMap.Given overlay A followed by disjoint overlay B, the resulting state was effectively:
A subsequent reset read only B, removed only B-owned entries, and deleted provenance. Entries from A remained live without any durable ownership record, so an old RPC upstream could continue receiving traffic after the operator believed it had been replaced and reset.
Reset had a related failure mode: cluster cleanup was best-effort, but the durable overlay and provenance files were deleted even when cleanup failed. That made a transient Kubernetes failure permanently discard the information needed for a later retry.
Implementation
Replacement reconciliation now follows this model:
Before merging the desired overlay, reconciliation:
Persisting union provenance first makes the intermediate states recoverable. If the process or cluster write fails, the saved desired overlay and union ownership record allow the next stack-up reconcile to complete the transition.
For overlays created before provenance tracking,
SetERPCrecords legacy drop markers before replacing the old document so their keys are not forgotten.Reset now returns an error and retains both durable files when live cleanup fails.
Scope
This changes replacement and reset semantics for overlay-owned
networksandupstreams, the entries that control routing. The existing intentional behavior for rate limiters and cache policies is unchanged.Validation
go test ./internal/network -count=1go test -race ./internal/network -count=1go vet ./internal/networkgo test ./cmd/obol ./internal/stack -count=1go test ./... -count=1just buildgit diff --check