]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/PGMonitor: calc the %USED of pool using used/(used+avail) 10584/head
authorKefu Chai <kchai@redhat.com>
Fri, 5 Aug 2016 06:27:43 +0000 (14:27 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 6 Aug 2016 17:37:40 +0000 (01:37 +0800)
commit08532ea166dfd97c548d9f1fb478e163021cdda3
treeb1473048b06825f63ff05a69c7c491862bc62151
parentaf3d3e25823ca9b40ddf09835edb82795ac68f33
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>
src/common/TextTable.h
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/test/mon/CMakeLists.txt
src/test/mon/PGMonitor.cc [new file with mode: 0644]