mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
Merge pull request #13307 from songbaisen/s12
osd: add is_split check before _start_split Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
5de6a0a4c1
@ -358,11 +358,12 @@ void OSDService::_maybe_split_pgid(OSDMapRef old_map,
|
||||
spg_t pgid)
|
||||
{
|
||||
assert(old_map->have_pg_pool(pgid.pool()));
|
||||
if (pgid.ps() < static_cast<unsigned>(old_map->get_pg_num(pgid.pool()))) {
|
||||
int old_pgnum = old_map->get_pg_num(pgid.pool());
|
||||
if (pgid.ps() < static_cast<unsigned>(old_pgnum)) {
|
||||
set<spg_t> children;
|
||||
pgid.is_split(old_map->get_pg_num(pgid.pool()),
|
||||
new_map->get_pg_num(pgid.pool()), &children);
|
||||
_start_split(pgid, children);
|
||||
if (pgid.is_split(old_pgnum,
|
||||
new_map->get_pg_num(pgid.pool()), &children)) {
|
||||
_start_split(pgid, children); }
|
||||
} else {
|
||||
assert(pgid.ps() < static_cast<unsigned>(new_map->get_pg_num(pgid.pool())));
|
||||
}
|
||||
|
@ -610,6 +610,7 @@ public:
|
||||
int get_pg_num(int pg_pool) const
|
||||
{
|
||||
const pg_pool_t *pool = get_pg_pool(pg_pool);
|
||||
assert(NULL != pool);
|
||||
return pool->get_pg_num();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user