Skip to content

mvcc: add watch failpoints for robustness testing#22044

Open
darshil929 wants to merge 1 commit into
etcd-io:mainfrom
darshil929:add-watch-failpoints
Open

mvcc: add watch failpoints for robustness testing#22044
darshil929 wants to merge 1 commit into
etcd-io:mainfrom
darshil929:add-watch-failpoints

Conversation

@darshil929

Copy link
Copy Markdown

This adds three gofail failpoints to the etcd server watch code so the robustness tests can inject slowness into the paths listed in issue #18681: watcher synchronization, victim resynchronization, and progress notification. All three sit in server/storage/mvcc/watchable_store.go, right before each function takes the store lock, so an injected sleep delays the operation without holding the lock during the sleep.

  • beforeSyncWatchers in syncWatchers, the batch that catches up unsynced watchers from the backend. Slowness here simulates watchers on old revisions staying behind under load.
  • beforeMoveVictims in moveVictims, which retries delivery to watchers whose channels blocked. Slowness here extends the backpressure window while the system is already struggling.
  • beforeProgressIfSync in progressIfSync, which both the periodic progress notify ticker and manual progress requests flow through. Slowness here stresses clients that depend on progress guarantees, like the case in Watch on future revision might receive old events or notifications, happens when client connects to multiple members. #20221

Each failpoint is registered as a gofailSleepAndDeactivate for the exploratory scenarios, following the same pattern as beforeSendWatchResponse from #17680. No build changes are needed since gofail-enable already instruments server/storage/mvcc.

Validation:

  • Built with make gofail-enable and make build, confirmed all three failpoints appear on the GOFAIL_HTTP endpoint.
  • Manually activated beforeSyncWatchers=sleep(1000) on a live member, verified watch delivery stays correct and the endpoint stays healthy.
  • Ran TestRobustnessExploratory/KubernetesLowTraffic with the new failpoints in the pool, which passes.

Fixes #18681

Signed-off-by: darshil929 <darshilt.work29@gmail.com>
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: darshil929
Once this PR has been reviewed and has the lgtm label, please assign spzala for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow

Copy link
Copy Markdown

Hi @darshil929. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@serathius

Copy link
Copy Markdown
Member

/ok-to-test

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.65%. Comparing base (b9ba05c) to head (2403dcf).

Additional details and impacted files
Files with missing lines Coverage Δ
server/storage/mvcc/watchable_store.go 92.88% <ø> (ø)

... and 12 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #22044      +/-   ##
==========================================
- Coverage   69.66%   69.65%   -0.02%     
==========================================
  Files         449      449              
  Lines       38177    38177              
==========================================
- Hits        26596    26591       -5     
- Misses      10149    10153       +4     
- Partials     1432     1433       +1     

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9ba05c...2403dcf. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@darshil929

Copy link
Copy Markdown
Author

/retest

2 similar comments
@serathius

Copy link
Copy Markdown
Member

/retest

@henrybear327

Copy link
Copy Markdown
Contributor

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Introduce more failpoints into etcd watch

3 participants