Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: OSDMonitor: fix the check error of pg creating #10916

Merged
merged 1 commit into from Oct 10, 2016
Merged

mon: OSDMonitor: fix the check error of pg creating #10916

merged 1 commit into from Oct 10, 2016

Conversation

ghost
Copy link

@ghost ghost commented Aug 30, 2016

@tchaikov
Copy link
Contributor

tchaikov commented Sep 8, 2016

@jordan41177 the change looks good to me, could you add a simple test in test_mon_osd_pool() in qa/workunits/cephtool/test.sh ?

@tchaikov tchaikov self-assigned this Sep 8, 2016
@@ -1514,6 +1514,9 @@ function test_mon_osd_pool_set()
wait_for_clean
ceph osd pool set $TEST_POOL_GETSET pgp_num 10

ceph osd pool set $TEST_POOL_GETSET pg_num 106
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you squash this commit into the previous one? or add a prefix ("qa/workunits/cephtool/test.sh: ") to the title of the commit message of this commit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay @tchaikov , I will fix it after a week...(for a trip). Sorry for late.

@ghost
Copy link
Author

ghost commented Sep 19, 2016

@tchaikov
It's done. I combined two changes in one commit.

@tchaikov
Copy link
Contributor

@jordan41177 could you put "Fixes: http://tracker.ceph.com/issues/17169" in your commit message? right before your "Signed-off-by" line.

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
@hjwsm1989
Copy link
Contributor

lgtm

@ghost
Copy link
Author

ghost commented Oct 4, 2016

@tchaikov @hjwsm1989
how about this PR?

@tchaikov
Copy link
Contributor

@tchaikov tchaikov merged commit d2b6b34 into ceph:master Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants