Skip to content

Commit

Permalink
mon/PGMonitor: bug fix pg monitor get crush rule
Browse files Browse the repository at this point in the history
when some rules have been deleted before, the index in array of crush->rules
is not always equals to crush_ruleset of pool.

Fixes: ceph#12210
Reported-by: Ning Yao <zay11022@gmail.com>
Signed-off-by: Xinze Chi <xmdxcxz@gmail.com>
  • Loading branch information
XinzeChi committed Jul 3, 2015
1 parent 3325f82 commit 4987933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mon/PGMonitor.cc
Expand Up @@ -1023,8 +1023,8 @@ bool PGMonitor::register_new_pgs()
++p) {
int64_t poolid = p->first;
pg_pool_t &pool = p->second;
int ruleno = pool.get_crush_ruleset();
if (!osdmap->crush->rule_exists(ruleno))
int ruleno = osdmap->crush->find_rule(pool.get_crush_ruleset(), pool.get_type(), pool.get_size());
if (ruleno < 0 || !osdmap->crush->rule_exists(ruleno))
continue;

if (pool.get_last_change() <= pg_map.last_pg_scan ||
Expand Down

0 comments on commit 4987933

Please sign in to comment.