Handle cluster migrations gracefully in front-proxy - #4219
Conversation
|
/retest |
|
/restart |
|
/retest time=2026-06-20T21:50:58.066Z level=ERROR source=manager.go:259 msg="error reloading target set" component="scrape manager" err="invalid config id:kcp-shared-TestUserWithWarrants-1781992249" |
| // This is only required for watches. | ||
| // Lists with a lower RV will get appropriate objects from the shard. | ||
| // Lists with a higher RV will get a 504 from the shard. | ||
| if index.RecentlyMigrated(result.Cluster) && isInProgressWatch(req) { |
There was a problem hiding this comment.
Hmm, what about clients that HAVE done a list before, already know a good RV on the new shard, and want to watch from there on; all while this 90s period is ticking? Maybe the error message could be a bit more helpful, like: ...; watch with resourceVersion temporarily unavailable, or something along those lines.
This could be called a pretty hard nit-picking, but a random user, looking at logs of their client might not know what is going on.
There was a problem hiding this comment.
Lists shouldn't be affected, they are just passed through to the shard and as mentioned in the comment they'll either have a lower RV than the new shard, in which case they'll get a diff to the current RV of the new shard.
If they have a higher RV than the new shard the shard will respond with a 504, causing the client to do a relist.
There was a problem hiding this comment.
The original implementation also rejected lists but the more I read the code for reflectors the less it made sense to handle lists instead of letting them through^^
There was a problem hiding this comment.
@ntnn, what I meant is that the user does List, knows the correct RV, and does a subsequent Watch starting from that point in time.
It's fine for Watch to reject - I don't disagree with that. Just the log msg is hiding the real reason for the rejection and would (at least for me) read as something unrelated being wrong, whereas in fact it's only a temporary thing.
There was a problem hiding this comment.
I updated the error message, I think its clearer now
| // A watch opened *after* the migration must be live, not stuck in a sticky | ||
| // cancelled state. This guards against using a sticky Cancel instead of a | ||
| // one-shot Delete, which would permanently kill all watches for the cluster. |
There was a problem hiding this comment.
Huh? Sounds like the agent had a bit more context than what's in the comment here :P
There was a problem hiding this comment.
:D Sortof yes, the comments in the original code (from where I copied the context handling) talked about the sticky cancellation and thats what it ran with when building the tests :D
There was a problem hiding this comment.
Yeah but can you pls expand on that thought INSIDE the comment? :D Otherwise nobody knows what that means. Or maybe it's just that I'm uneducated and this is common knowledge?
There was a problem hiding this comment.
True :D Updated with a comment on how the contextmanager handles the context
|
LGTM label has been added. DetailsGit tree hash: 56d5c699a0bd63491663fc41e8642ff28479d112 |
|
@mjudeikis were the comments I sent resolved, or the review overall was deemed without merit and it was decided that this can go ahead? |
Sorry, I think I tagged this by mistake while going via all backlist |
|
/lgtm I need this as its keep flaking in CI |
|
LGTM label has been added. DetailsGit tree hash: db98c462c4c231f66a6b46f1dd4d8a03abec9d28 |
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
f469cf5 to
a57e5af
Compare
|
/retest That looks like infra errors? |
|
/retest |
|
@ntnn: The following test failed, say
DetailsInstructions 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. I understand the commands that are listed here. |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: bfe1a36d6961993c5a02c3d39091175df1a7879b |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Fixes the flake with the pre-migration watch.
What Type of PR Is This?
/kind bug
/kind flake
Related Issue(s)
Fixes #
Release Notes