After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707644 - Move ref writing to be transaction-based
Move ref writing to be transaction-based
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-06 17:03 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-09-07 00:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
builtin-refs: Remove the ref delete function (2.49 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
repo: Make the ordering consistent between abort/complete_transaction (1.69 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Make OSTreeCommitModifier introspectable (3.67 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Make prepare_transaction introspectable (1.46 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Move commit code to another file (126.90 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Rename "stage" to "write" in the API (45.96 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Move the transaction stats to a separate struct (11.89 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Make abort_transaction silently succeed if we're not in a transaction (2.71 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
Move ref writing to be transaction-based (20.48 KB, patch)
2013-09-06 17:03 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:19 UTC
This is something Colin and I talked about yesterday. It doesn't make
ref writing atomic (since we write a bunch of different files), but
it will help with that.

I haven't talked it over with Colin yet, but I think it makes to store
all refs one file, like the summary file, and simply parse/write that,
rather than having each ref be a different file in the filesystem.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:22 UTC
Created attachment 254276 [details] [review]
builtin-refs: Remove the ref delete function

This should be part of write-refs
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:26 UTC
Created attachment 254277 [details] [review]
repo: Make the ordering consistent between abort/complete_transaction
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:28 UTC
Created attachment 254278 [details] [review]
repo: Make OSTreeCommitModifier introspectable
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:31 UTC
Created attachment 254279 [details] [review]
repo: Make prepare_transaction introspectable
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:34 UTC
Created attachment 254280 [details] [review]
repo: Move commit code to another file
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:38 UTC
Created attachment 254281 [details] [review]
repo: Rename "stage" to "write" in the API
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:42 UTC
Created attachment 254282 [details] [review]
repo: Move the transaction stats to a separate struct

This is much easier for callers to handle, and simplifies
the API a lot.
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:44 UTC
Created attachment 254283 [details] [review]
repo: Make abort_transaction silently succeed if we're not in a transaction

This helps callers out a lot, and means we can always call abort_transaction
at the end of a function.
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-09-06 17:03:47 UTC
Created attachment 254284 [details] [review]
Move ref writing to be transaction-based

Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.
Comment 10 Colin Walters 2013-09-06 19:56:47 UTC
Review of attachment 254276 [details] [review]:

I'd rather kill off write-refs; "refs" is a bit more general purpose, just like "git tag" allows you to both create and delete.
Comment 11 Colin Walters 2013-09-06 19:57:11 UTC
Review of attachment 254277 [details] [review]:

LGTM
Comment 12 Colin Walters 2013-09-06 19:57:36 UTC
Review of attachment 254278 [details] [review]:

Right.
Comment 13 Colin Walters 2013-09-06 19:57:50 UTC
Review of attachment 254279 [details] [review]:

Yep.
Comment 14 Colin Walters 2013-09-06 19:58:01 UTC
Review of attachment 254280 [details] [review]:

Makes sense.
Comment 15 Colin Walters 2013-09-06 19:58:10 UTC
Review of attachment 254281 [details] [review]:

Definitely.
Comment 16 Colin Walters 2013-09-06 19:58:24 UTC
Review of attachment 254282 [details] [review]:

OK.
Comment 17 Colin Walters 2013-09-06 19:58:41 UTC
Review of attachment 254283 [details] [review]:

Feels a bit weird to have abort at the end of every function, but OK.
Comment 18 Colin Walters 2013-09-06 20:02:56 UTC
Review of attachment 254284 [details] [review]:

Need to update gnome-ostree for this right?

Maybe instead of _write_ref call it _set_ref() since we aren't actually writing at that point?

Otherwise looks good to me.
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-09-07 00:33:33 UTC
pushed all of these
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-09-07 00:33:58 UTC
well, except the one that deletes builtin-refs. also made other api cleanups and applied review comments