New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to empty PATCH when migrating resources #65
Comments
Would an empty patch actually trigger the server to do a write? |
I've manually tested it with the tool I wrote for Knative here The assumption I have is that you can only remove entries from the CRD's After the tool patches all the resources I'm able to drop older storage versions - so I believe PATCH'ing causes a server write. If not then... |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I don't think the apiserver checks/tracks all the CRs before updating the CRD |
I cannot think of a reason for not doing an empty patch either. The only short-circuit that I'm aware of happens after encoding (and conversion). I tried empty-patching a stale CR (noop conversion). The write didn't get short-circuited. I assume it's because the encoding sets the |
/remove-lifecycle stale |
/assign Let me add some test and do the switch |
Talked with @caesarxuchao. The reason we did UPDATE instead of PATCH was because UPDATE is more general. There can be aggregated apiservers who don't implement patchers (e.g. jsonPatcher) and therefore don't support PATCH. We also discussed the existing UPDATE code, and found that we can improve the performance by avoiding retry on conflict #78 (note that we already skipped the initial GET before UPDATE)-- then the throughput for UPDATE v.s. PATCH would be:
So the performance would be similar, while UPDATE is easier for aggregated apiservers to support. /close |
@roycaihw: Closing this issue. In response to this:
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/test-infra repository. |
Doesn't |
Yes. However, because the list operation already downloads the entire resource, so the UPDATE just doubles the bandwidth cost, it's not a difference in the order of magnitude. Converting to PATCH does improve the performance, but it also means that we need to handle more corner cases like #65 (comment) mentioned, so I think it's not our current priority to convert to PATCH. That said, if using UPDATE is causing performance bottleneck in production, please let us know, we are willing to improve the performance now. |
Looking here:
kube-storage-version-migrator/pkg/migrator/core.go
Lines 63 to 77 in a8167b3
I notice that the migrator uses Updates/PUTs to perform the storage migration. Is it necessary to do the full PUT? This presentation makes it seems like an empty patch will suffice.
The text was updated successfully, but these errors were encountered: