Skip to content

atenet: make xDS snapshot versions restart-unique - #699

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:xds-version-restart
Open

atenet: make xDS snapshot versions restart-unique#699
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:xds-version-restart

Conversation

@orangeCatDeveloper

Copy link
Copy Markdown

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)

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.
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.

[P3] XDS versionCount resets to 1 on router restart — config changes may not reach Envoy

1 participant