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 756266 - Enhance size metadata functionality
Enhance size metadata functionality
Status: RESOLVED WONTFIX
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
: 709050 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-08 22:04 UTC by John Hiesey
Modified: 2018-08-17 18:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
commit: Store objtype in size index (2.95 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review
tests: Fix sizes test to check objtype (2.21 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review
commit: Use 64 bit types for size metadata (1.65 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review
commit: Store sizes for all object types (2.64 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review
commit: Implement ostree_repo_get_commit_sizes to read size index (5.98 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review
Implement the size-summary command (8.52 KB, patch)
2015-10-08 22:06 UTC, John Hiesey
none Details | Review

Description John Hiesey 2015-10-08 22:04:30 UTC
Currently there is no code in ostree to parse the size index even though there is code to generate it.

I have some patches to add a function to read this data to the libostree api and also a command (currently named size-summary) to print it on the command line.
Comment 1 John Hiesey 2015-10-08 22:06:08 UTC
Created attachment 312928 [details] [review]
commit: Store objtype in size index

If the objtype is not stored in the size index, the index will
be ambiguous if the size of anything other than regular files
is stored.

This adds the objtype in a single byte following the existing data,
ensuring that code designed to read the old format will continue
to work with this addition.
Comment 2 John Hiesey 2015-10-08 22:06:11 UTC
Created attachment 312929 [details] [review]
tests: Fix sizes test to check objtype

Test the new objtype field of the size index.
Comment 3 John Hiesey 2015-10-08 22:06:14 UTC
Created attachment 312930 [details] [review]
commit: Use 64 bit types for size metadata
Comment 4 John Hiesey 2015-10-08 22:06:17 UTC
Created attachment 312931 [details] [review]
commit: Store sizes for all object types

Since the metadata can account for a non-negligible amount of size,
add size index entries for other types of objects as well.
Comment 5 John Hiesey 2015-10-08 22:06:20 UTC
Created attachment 312932 [details] [review]
commit: Implement ostree_repo_get_commit_sizes to read size index

There is currently no code to read the size index. Add a function
ostree_repo_get_commit_sizes to read the total and new size of the
objects in a given commit in terms of both archived size (i.e.
download size) and unpacked size (i.e. on disk size).
Comment 6 John Hiesey 2015-10-08 22:06:23 UTC
Created attachment 312933 [details] [review]
Implement the size-summary command

size-summary prints information about the download size, on disk size,
and number of files necessary to pull a given branch.
Comment 7 Colin Walters 2015-10-10 22:06:09 UTC
I haven't looked at your patches here yet in depth, but in the big picture - do you agree that the static deltas will obsolete this?
Comment 8 John Hiesey 2015-10-16 20:51:39 UTC
I don't think that static deltas will obsolete this.

I agree that static deltas will handle the common case, but it doesn't seem feasible to generate static deltas from every existing old version every time a new version is released. The common case can be handled by static deltas, but not the long tail of really old versions being upgraded to latest.

Also, how do I determine the size of a static delta accurately before it's downloaded? I see that ostree_repo_static_delta_generate computes it, but I don't see it being stored anywhere. Were you hoping for some code to store and read that data?
Comment 9 Colin Walters 2016-06-23 22:30:11 UTC
Picking this back up again, and sorry about the delay.  Nowadays it's better to submit patches to github BTW.

Since we've talked, the core ostree now displays the static delta sizes:
https://github.com/ostreedev/ostree/commit/4beb5f4eaf619f1c47762bb872099e24f3efe2f0

As far as covering deltas everywhere - one thing that the delta *design* supports (although the code isn't really tested), is delta recursion.  Basically let's say you have 5 commits.

v0
v1
v2
v3
v4

The idea is we generate a delta tree, like:

v0-v1
v1-v2
v2-v3
v3-v4

Then:
v0-v2
v2-v4

And finally:
v0-v4
 - v0-v2
 - v2-v4

It's also be possible of course for v0-v2 to simply recurse v0-v1 v1-v2.  But while I haven't done any real world math on this I suspect for most uses having a binary tree would work well.
Comment 10 Colin Walters 2016-06-23 22:33:15 UTC
*** Bug 709050 has been marked as a duplicate of this bug. ***
Comment 11 André Klapper 2018-08-17 18:58:40 UTC
OSTree has moved to Github a while ago.
Furthermore, GNOME Bugzilla will be shut down and replaced by gitlab.gnome.org.

If the problem reported in this Bugzilla ticket is still valid, please report it to https://github.com/ostreedev/ostree/issues instead. Thank you!

Closing this report as WONTFIX as part of Bugzilla Housekeeping.