-
Notifications
You must be signed in to change notification settings - Fork 293
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
lib/repo-pull: Retry pulls without static deltas if they fail #1612
base: main
Are you sure you want to change the base?
Conversation
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. WIP: This needs some work to tidy it up. Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873
fb67e9a
to
3e02c48
Compare
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873
Currently, we manually handle the case of pulling a broken static delta failing, by checking for G_IO_ERROR_NOT_FOUND from a pull, and retrying with disable-static-deltas=true set. In future, this may be handled internally by libostree, and hence we could eventually drop our handling for it. See ostreedev/ostree#1612. Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873
We already fallback if we fail to fetch the superblock, right? So this seems to be specifically about falling back if we fail to fetch one of the delta parts? I'm not sure how likely it is that we'd successfully fetch the superblock but fail on one of the delta parts. (Or is this something you've seen happen in the wild more than once?) |
Having looked back to the code which we originally added in eos-updater for this (about a year ago), it’s to fix this error:
The analysis we did concluded that there was nothing wrong with the repository on the server (or mirror), but that the client’s repository was missing an object from the previous commit, so the delta could not be applied. I think the mechanism for that object going missing locally in the first place was a lack of locking between the updater and gnome-software, with a prune operation by one process racing with an update by the other. That’s been solved with the locking stuff dbn introduced though. While that cause of a corrupt repository has been fixed, it’s conceivable that a local repository could get corrupted another way. It would be nice to be robust to that kind of failure, given that the non-static-delta code already is. |
Thanks for the context. Wrapping the whole function still feels a bit strong-handed though. This is something |
We already do that today - I think I added it for the Won't help existing systems though - those need a new Perhaps the simplest hack is to - if we encounter ENOENT when loading an object (during delta processing), drop into the fsck code and mark it partial. |
We're only checking for
Hmm, and a message to retry the operation? Not as magical, but that works too. (Actually, we probably should print something however this gets implemented, since missing objects means something went wrong.) |
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873
Currently, we manually handle the case of pulling a broken static delta failing, by checking for G_IO_ERROR_NOT_FOUND from a pull, and retrying with disable-static-deltas=true set. In future, this may be handled internally by libostree, and hence we could eventually drop our handling for it. See ostreedev/ostree#1612. Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873
Indeed, that’s how I read the function. I don’t see anything which could detect if an object referenced by a commit is missing; just code to detect if the commit itself is missing.
That makes sense to me, though I guess there could be a concern about statting the entire OS several times over before settling on a best from-commit to use for the static delta. It would be done on every pull, too, not just if the delta code found that an object was missing.
I’d be much more in favour of something magical, which doesn’t require manually retrying the operation. Marking a commit as partial if |
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
@cgwalters, @jlebon, any further thoughts on this? |
Actually, thinking about it some more, the cost of statting all the objects in the source commit might well be quite high. Going with the principle of “ask foregiveness rather than permission”, I think it might be better to do what I have in the current version of the PR: try the static delta update, and if that fails, do something about it, rather than trying to check perfectly that the static delta update will work before trying it. The downside of the PR in its current form is that it means the user downloads the entire static delta, discards it, and then downloads the update object-by-object again, which uses (roughly) twice as much data as needed. So perhaps a hybrid solution, as mentioned in some of the comments above, would work? Try the static delta and, if that fails, run enough of the fsck code to fix up the source commit, and try again? If that fails, retry the whole update with static deltas disabled (as in the current version of the PR). |
OK yeah, that makes sense to me, regardless of whatever implementation we settle on.
How about this:
That way we only ever fully
I think for one commit it's not so bad? Anyway, if it turns out to indeed be complete (which will be the case the great majority of the time), warming up those files is probably helpful when we run the static delta ops that read from them. |
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now.
@pwithnall: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
If pulling a static delta fails (due to one part of it missing from a mirror, for example), retry the entire pull operation with disable-static-deltas=true. This is a functional, but ugly approach to fixing the problem, and a neater solution may be adopted upstream in future. If so, this commit should be dropped and replaced with the upstream solution: ostreedev/ostree#1612 Signed-off-by: Philip Withnall <[email protected]> https://phabricator.endlessm.com/T22873 Rebase 2018.6 (T23138): Fix a minor merge conflict due to "#ifdef OSTREE_ENABLE_EXPERIMENTAL_API" being gone now. Rebase 2023.5 (T35068): Fix merge conflict with upstream reformatted function signature. Run clang-format to comply with upstream style.
If pulling a static delta fails (due to one part of it missing from a
mirror, for example), retry the entire pull operation with
disable-static-deltas=true.
WIP: This needs some work to tidy it up.
Signed-off-by: Philip Withnall [email protected]
https://phabricator.endlessm.com/T22873
This is a WIP commit, mostly submitted as a PR to get feedback on the concept. If you’re happy with the concept, I’ll clean the code up. I was wondering whether this is something which you might want controlled by an option (e.g.
disable-static-deltas-on-failure
) or always enabled.