Project

General

Profile

Bug #43384

mgr/dashboard: Pool size is calculated with data with different metrics

Added by Stephan Müller 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
dashboard/pools
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

Currently we use the following calculation in the dashboard to calculate the usage:

const avail = stats.bytes_used.latest + stats.max_avail.latest;
pool['usage'] = avail > 0 ? stats.bytes_used.latest / avail : avail;

[pool-list.component.ts:253-4]

The problem is that "max_avail" is calculated somewhat strangely as it does not show the real available space as it divides the available space at least through the number of replications for a replicated and by "(m+k)/k" for an ec pool.

To look the calculation up go to the following locations:
https://github.com/ceph/ceph/blob/master/src/osd/OSDMap.cc#L6033
https://github.com/ceph/ceph/blob/master/src/osd/OSDMap.cc#L6040
https://github.com/ceph/ceph/blob/master/src/osd/OSDMap.cc#L6054

https://github.com/ceph/ceph/blob/master/src/mon/PGMap.cc#L909
https://github.com/ceph/ceph/blob/master/src/mon/PGMap.cc#L920
https://github.com/ceph/ceph/blob/master/src/mon/PGMap.cc#L924
https://github.com/ceph/ceph/blob/master/src/mon/PGMap.cc#L947

This problem was found out by a user who notified us about the percentage mismatch, here is the link to the mail:
http://lists.ceph.com/pipermail/ceph-users-ceph.com/2019-December/037680.html

Also found this thread on the new mailing list regarding the used percentage and max_avail topic:
https://lists.ceph.io/hyperkitty/list/ceph-users@ceph.io/thread/NH2LMMX5KVRWCURI3BARRUAETKE2T2QN/#JDHXOQKWF6NZLQMOGEPAQCLI44KB54A3

Also available in: Atom PDF