Bug #43384
mgr/dashboard: Pool size is calculated with data with different metrics
0%
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
Related issues
History
#1 Updated by Lenz Grimmer almost 3 years ago
- Duplicates Bug #45185: mgr/dashboard: fix usage calculation to match "ceph df" way added
#2 Updated by Lenz Grimmer almost 3 years ago
- Status changed from New to Duplicate
This is a duplicate of #45185 which was already resolved.
#3 Updated by Ernesto Puerta over 2 years ago
- Project changed from mgr to Dashboard
- Category changed from 137 to Component - Pools