]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/PGMonitor: calc the %USED of pool using used/(used+avail) 11934/head
authorKefu Chai <kchai@redhat.com>
Fri, 5 Aug 2016 06:27:43 +0000 (14:27 +0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 12 Nov 2016 11:00:33 +0000 (12:00 +0100)
commit64eeb8d96cf295c8a3739d5d993b51f77c35e466
treed4cdc97ebff8021722c5c70068d31c1efeb30dac
parentd62258c03492fca5fca99650cc7514348251cb7b
mon/PGMonitor: calc the %USED of pool using used/(used+avail)

we were using
"the raw space used by this pool" / "the raw space of the whole cluster"
as the %USED. but it's wrong:

- there is chance that not all OSDs are assigned to the pool in question
- we can not utilize all the raw space for the pool: there is overhead.
  and the size of available space for a pool is capped by the assigned
  OSD with minimal free space.

so we should use
 USED / (USED + AVAIL)
as the %USED. so once we have no AVAIL space left, %USED will be 100%.

Fixes: http://tracker.ceph.com/issues/16933
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 08532ea166dfd97c548d9f1fb478e163021cdda3)

Conflicts:
src/test/mon/CMakeLists.txt (file does not exist in hammer)
src/common/TextTable.h
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/test/mon/PGMonitor.cc [new file with mode: 0644]