-
Notifications
You must be signed in to change notification settings - Fork 305
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
Conversation
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.
1319401
to
1bf3940
Compare
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.
src/libostree/ostree-repo-commit.c
Outdated
* 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/be/will be/
?
src/libostree/ostree-repo-commit.c
Outdated
* | ||
* 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, | |||
{ |
There was a problem hiding this comment.
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?
This one can wait until after #1359 |
OK release done, see fixup ⬆️ above |
☀️ Test successful - status-atomicjenkins |
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.
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
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.
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
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.