]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: OSDMonitor: fix the check error of pg creating 10916/head
authorDesmondS <jordanjimmy41177@gmail.com>
Tue, 30 Aug 2016 03:40:00 +0000 (11:40 +0800)
committerDesmondS <jordanjimmy41177@gmail.com>
Mon, 19 Sep 2016 09:59:01 +0000 (17:59 +0800)
commit179d3d165955e91fb8bd88613af9424f20782d01
tree3cfe0a8c32c51fbb72ba64d2926d0879519c41c1
parent159a58464dabc6ff8dd9eb82a126c6a90f555f89
mon: OSDMonitor: fix the check error of pg creating

The variable 'pgs_per_osd' set value from 'new_pgs' divided by 'expected_osds',
and its type is integer. So it would remove the decimal point and get smaller value.
This would have problem in some situations, for exmaple:

The limitation of pg creating for one OSD is '32'.
There have 3 OSDs and I want to increase pgs for a pool.
It should be the limitation for creating new pgs up to '96(32 * 3)' at once.
Now, I create '98' pgs for a pool.

In original code, '98' would be divided by 'expected_osds' and get the floating value '32....'
Because of the type which is integer, the 'pgs_per_osd' would be set to 32.
Then the value won't bigger than the limitation and get the wrong result.

Signed-off-by: DesmondS <desmond.s@inwinstack.com>
Fixes: http://tracker.ceph.com/issues/17169
qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc