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

luminous: mon/PGMap: Fix %USED calculation #19230

Merged
merged 1 commit into from Nov 29, 2017

Conversation

Projects
None yet
3 participants
@tchaikov
Contributor

tchaikov commented Nov 29, 2017

mon/PGMap: Fix %USED calculation bug.
Previous code forgot to multiple raw_used_ratio to calculate
used byte.

Fixes: http://tracker.ceph.com/issues/22247
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
(cherry picked from commit d10c6c2)

@tchaikov tchaikov added this to the luminous milestone Nov 29, 2017

@xiaoxichen

lgtm

@gregsfortytwo

Reviewed-by: Greg Farnum gfarnum@redhat.com

if (avail) {
used = sum.num_bytes * curr_object_copies_rate;
used = sum.num_bytes * raw_used_rate * curr_object_copies_rate;

This comment has been minimized.

@gregsfortytwo

gregsfortytwo Nov 29, 2017

Member

I know this is a backport, but I don't understand at all why we are multiplying by both the raw_used_rate (which is pool->get_size() for replicated pools) and the curr_object_copies_rate.

...oh, it's because curr_object_copies_rate is actually about how many objects actually exist compared to those that are supposed to exist.

@gregsfortytwo

gregsfortytwo Nov 29, 2017

Member

I know this is a backport, but I don't understand at all why we are multiplying by both the raw_used_rate (which is pool->get_size() for replicated pools) and the curr_object_copies_rate.

...oh, it's because curr_object_copies_rate is actually about how many objects actually exist compared to those that are supposed to exist.

@gregsfortytwo gregsfortytwo merged commit 6d9f216 into ceph:luminous Nov 29, 2017

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment