-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
system df: fix image-size calculations #16211
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The failures seem to be triggered by containers/storage@main |
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.
Could you run your new tests against main
? They pass for me, which means you're not actually testing your changes.
1f3279c
to
00d1056
Compare
Easy reproducer among others:
|
Out of curiosity, do you know when this broke? Last night's treadmill job passed. Could the breakage have happened late last night? Or is the treadmill broken? |
No idea, sorry. c/storage had a lot of traffic recently. |
Code LGTM |
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.
Tests are still broken, in the sense that they pass on main
. You are not testing anything new. Can you please find a way to write tests that break on main
and pass with this PR?
Thanks for checking, Ed! Will do 👍 Also need to update the apiv2 tests:
|
Fix two bugs in `system df`: 1. The total size was calculated incorrectly as it was creating the sum of all image sizes but did not consider that a) the same image may be listed more than once (i.e., for each repo-tag pair), and that b) images share layers. The total size is now calculated directly in `libimage` by taking multi-layer use into account. 2. The reclaimable size was calculated incorrectly. This number indicates which data we can actually remove which means the total size minus what containers use (i.e., the "unique" size of the image in use by containers). NOTE: The c/storage version is pinned back to the previous commit as it is buggy. c/common already requires the buggy version, so use a `replace` to force/pin. Fixes: containers#16135 Signed-off-by: Valentin Rothberg <[email protected]>
@edsantiago can you take another look at the tests? |
ARGH! Sorry; left tests running this morning, moved on to something else. New test looks great, and fails (as it should) on main. Thank you! |
Fix two bugs in
system df
:The total size was calculated incorrectly as it was creating the sum of all image sizes but did not consider that a) the same image may be listed more than once (i.e., for each repo-tag pair), and that b) images share layers.
The total size is now calculated directly in
libimage
by taking multi-layer use into account.The reclaimable size was calculated incorrectly. This number indicates which data we can actually remove which means the total size minus what containers use (i.e., the "unique" size of the image in use by containers).
Fixes: #16135
Signed-off-by: Valentin Rothberg [email protected]
Does this PR introduce a user-facing change?