Skip to content
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

Actually use from-scratch deltas #3413

Merged
merged 6 commits into from
Feb 13, 2020

Conversation

alexlarsson
Copy link
Member

As noticed in #3412 we
regressed at some point and are no longer using from-scratch deltas.
This is caused by an optimization in ostree where it decides to not
use a from-scratch deltas if theres is some version of the ref
locally available.

This conflicts with some code in flatpak that pulls only the commit
object in order to look for extra data size information so that we can
get the progress reporting right. Unfortunately the existance of
just the object triggers the above causing us to never use from-scratch
deltas.

We fix this by throwing away the partial pull in an aborted ostree
transaction.

@alexlarsson
Copy link
Member Author

As an example of this, the webkit Sdk example in #3412 goes from 2 meg/sec to 30 meg/sec for me.

common/flatpak-dir.c Outdated Show resolved Hide resolved
Copy link

@clopez clopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it.
Now the download from its much faster!
Thanks!

@dbnicholson
Copy link
Contributor

@alexlarsson judging by what this commit does, I believe a fix in ostree would be to check if the revision you already have is in a partial state as would happen if you do a commit metadata only pull. Does that make sense?

@alexlarsson
Copy link
Member Author

@dbnicholson Im not sure that is a perfect solution, commented on the PR.

This makes it easier to see what message comes from where.
As noticed in flatpak#3412 we
regressed at some point and are no longer using from-scratch deltas.
This is caused by an optimization in ostree where it decides to not
use a from-scratch deltas if theres is *some* version of the ref
locally available.

This conflicts with some code in flatpak that pulls *only* the commit
object in order to look for extra data size information so that we can
get the progress reporting right. Unfortunately the existance of
just the object triggers the above causing us to *never* use from-scratch
deltas.

We fix this by throwing away the partial pull in an aborted ostree
transaction.
This breaks Deploy which can't find the ref. It used to work due to
the extra non-mirroring pull in flatpak_dir_setup_extra_data, but
this is not needed here.
This isn't actually used ununitialized, but gcc can't figure that out.
…branches

We never have extra data for non app/ or runtime/ refs, so lets not
do an unnecessary pull there.
@alexlarsson alexlarsson merged commit b03916f into flatpak:master Feb 13, 2020
extra_data_sources = flatpak_repo_get_extra_data_sources (repo, rev, cancellable, NULL);

if (!ostree_repo_abort_transaction (repo, cancellable, error))
return FALSE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this dance with aborting the transaction, can you pull just the rev without the ref? That's supported in ostree and then you won't update the ref and you'll avoid the issue where ostree sees a partial rev on the ref when the local ref didn't exist before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does pulling a rev without a ref work with the p2p case? I was sorta assuming it didn't. Yet another reason why p2p should die in flames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants