atenet: make xDS snapshot versions restart-unique - #699
Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
Open
atenet: make xDS snapshot versions restart-unique#699NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
Conversation
The in-memory version counter restarted at 1 on every router boot; if Envoy reconnected still holding an identical version string the snapshot cache saw a match and skipped the push, stranding Envoy on pre-restart config. Versions now carry a per-process epoch (unix seconds plus a random suffix) so no incarnation repeats an earlier one's strings, even across clock jumps. Fixes agent-substrate#617.
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.
Fixes #617
Summary
The xDS snapshot version was an in-memory counter starting at 0, so every router restart re-minted "1", "2", … go-control-plane's snapshot cache compares version strings for equality and skips the push when Envoy already reports that version, so a restarted router whose counter lands on the string Envoy still holds leaves Envoy silently stranded on pre-restart config.
Versions are now
<unix-seconds>-<8-char random>-<counter>— a per-process epoch no incarnation can repeat, even if the clock jumps backwards across a restart. version_info is opaque to Envoy and only ever compared for equality, so the format change is safe.Test plan
TestSnapshotVersionsUniqueAcrossRestarts: two XdsServer instances (simulating a restart) each deploy snapshots through the real SnapshotCache; asserts no version string repeats within or across instances.Live verification on a kind cluster: deployed the router, confirmed Envoy ACKed the new format via
config_dump, then SIGKILLed only the router container (Envoy kept running holding the old version) — after the restart Envoy ACKed a new-epoch version, proving the re-push reaches a reconnecting Envoy.Tests pass
Appropriate changes to documentation are included in the PR (none needed)