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

lib/repo: Add MT support for transaction_set_ref(), clarify MT rules #1358

Closed
wants to merge 2 commits into from

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Dec 1, 2017

For rpm-ostree I'd like to do importing in parallel with threads; the
code is almost ready for that except today it calls
ostree_repo_transaction_set_ref().

Looking at the code, there's really a "transaction" struct here,
not just stats. Let's lift that struct out, and move the refs
into it under the existing lock.

Clarify the documentation around multithreading for various functions.

For rpm-ostree I'd like to do importing in parallel with threads; the code is
*almost* ready for that except today it calls
`ostree_repo_transaction_set_ref()`.

Looking at the code, there's really a "transaction" struct here,
not just stats.  Let's lift that struct out, and move the refs
into it under the existing lock.

Clarify the documentation around multithreading for various functions.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Dec 1, 2017
Depends: ostreedev/ostree#1358

For jigdo ♲📦 in order to get true image speed like libostree has we need to
interleave and parallelize downloading and importing.

The messy part about this is having sync API do the "invoke and wait on various
async tasks" pattern. It's the same thing in `ostree_repo_pull_with_options()`.

Importing is pretty dramatically faster with this, I can only imagine the speed
win if we actually interleaved with downloads. However doing that requires
libdnf/librepo work.
* ostree_repo_commit_transaction(); that function takes care of writing all of
* the objects (such as the commit referred to by @checksum) before updating the
* refs. If the transaction is instead aborted with
* ostree_repo_abort_transaction(), no changes to the ref be made to the
Copy link
Member

Choose a reason for hiding this comment

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

s/be/will be/ ?

*
* Note however that currently writing *multiple* refs is not truly atomic; if
* the process or system is terminated during
* `ostree_repo_commit_transaction()`, it is possible that just some of the refs
Copy link
Member

Choose a reason for hiding this comment

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

Minor: seems like the convention is to not backtick-escape function names in documentation, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

gtk-doc should support both, but yeah let's be consistent in not doing it for now.

@@ -1573,9 +1584,10 @@ ostree_repo_transaction_set_refspec (OstreeRepo *self,
{
Copy link
Member

Choose a reason for hiding this comment

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

Missing multithreading advisory for this one?

@cgwalters
Copy link
Member Author

This one can wait until after #1359

@cgwalters
Copy link
Member Author

OK release done, see fixup ⬆️ above

@jlebon
Copy link
Member

jlebon commented Dec 4, 2017

@rh-atomic-bot r+ 37d1217

@rh-atomic-bot
Copy link

⌛ Testing commit 37d1217 with merge 89a57bb...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 89a57bb to master...

cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Dec 4, 2017
Depends: ostreedev/ostree#1358

For jigdo ♲📦 in order to get true image speed like libostree has we need to
interleave and parallelize downloading and importing.

The messy part about this is having sync API do the "invoke and wait on various
async tasks" pattern. It's the same thing in `ostree_repo_pull_with_options()`.

Importing is pretty dramatically faster with this, I can only imagine the speed
win if we actually interleaved with downloads. However doing that requires
libdnf/librepo work.
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Dec 5, 2017
Depends: ostreedev/ostree#1358

For jigdo ♲📦 in order to get true image speed like libostree has we need to
interleave and parallelize downloading and importing.

The messy part about this is having sync API do the "invoke and wait on various
async tasks" pattern. It's the same thing in `ostree_repo_pull_with_options()`.

Importing is pretty dramatically faster with this, I can only imagine the speed
win if we actually interleaved with downloads. However doing that requires
libdnf/librepo work.

Closes: #1124
Approved by: jlebon
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Dec 7, 2017
Depends: ostreedev/ostree#1358

For jigdo ♲📦 in order to get true image speed like libostree has we need to
interleave and parallelize downloading and importing.

The messy part about this is having sync API do the "invoke and wait on various
async tasks" pattern. It's the same thing in `ostree_repo_pull_with_options()`.

Importing is pretty dramatically faster with this, I can only imagine the speed
win if we actually interleaved with downloads. However doing that requires
libdnf/librepo work.
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Dec 7, 2017
Depends: ostreedev/ostree#1358

For jigdo ♲📦 in order to get true image speed like libostree has we need to
interleave and parallelize downloading and importing.

The messy part about this is having sync API do the "invoke and wait on various
async tasks" pattern. It's the same thing in `ostree_repo_pull_with_options()`.

Importing is pretty dramatically faster with this, I can only imagine the speed
win if we actually interleaved with downloads. However doing that requires
libdnf/librepo work.

Closes: #1124
Approved by: jlebon
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.

3 participants