fix(etcd): check availability before starting watcher - #13934
Open
shreemaan-abhishek wants to merge 1 commit into
Open
fix(etcd): check availability before starting watcher#13934shreemaan-abhishek wants to merge 1 commit into
shreemaan-abhishek wants to merge 1 commit into
Conversation
Config objects treat the shared watcher as started before watchdir is called. When a preload revision is available, no etcd request was made before publishing that state, so the objects could wait for events while the watcher was unable to connect. Probe etcd during every initial watcher setup. Keep using the preload revision as the cursor when one exists, and use the probe revision only as the existing fallback.
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.
Description
The shared etcd watcher publishes
watch_ctx.startedbefore callingwatchdir. Config objects interpret that state as permission to wait only for events from the watcher. When a preload revision was available, watcher initialization skipped the range request that otherwise verified etcd was reachable, so config objects could wait on a watcher that had not connected.This change extracts that range request into an explicit availability check and runs it during every initial watcher setup. The preload revision remains the watch cursor when present, preventing writes made after the snapshot from being skipped; the revision returned by the availability check is used only when no preload revision exists.
The startup-revision regression test now also verifies that the availability check occurs when the preload supplies the revision.
Which issue(s) this PR fixes:
N/A
Checklist