diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index eac39d52..72164be8 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -37,7 +37,7 @@ void osd_t::init_cluster() .pg_cursize = 0, .pg_size = 3, .pg_minsize = 2, - .parity_chunks = 1, + .pg_data_size = 2, .pool_id = 1, .pg_num = 1, .target_set = { 1, 2, 3 }, @@ -606,7 +606,8 @@ void osd_t::apply_pg_config() .pg_cursize = 0, .pg_size = pool_item.second.pg_size, .pg_minsize = pool_item.second.pg_minsize, - .parity_chunks = pool_item.second.parity_chunks, + .pg_data_size = pg.scheme == POOL_SCHEME_REPLICATED + ? 1 : pool_item.second.pg_size - pool_item.second.parity_chunks, .pool_id = pool_id, .pg_num = pg_num, .reported_epoch = pg_cfg.epoch, @@ -616,7 +617,7 @@ void osd_t::apply_pg_config() }; if (pg.scheme == POOL_SCHEME_JERASURE) { - use_jerasure(pg.pg_size, pg.pg_size-pg.parity_chunks, true); + use_jerasure(pg.pg_size, pg.pg_data_size, true); } this->pg_state_dirty.insert({ .pool_id = pool_id, .pg_num = pg_num }); pg.print_state(); @@ -807,7 +808,7 @@ void osd_t::report_pg_states() // Remove offline PGs after reporting their state if (pg_it->second.scheme == POOL_SCHEME_JERASURE) { - use_jerasure(pg_it->second.pg_size, pg_it->second.pg_size-pg_it->second.parity_chunks, false); + use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false); } this->pgs.erase(pg_it); } diff --git a/src/osd_peering_pg.cpp b/src/osd_peering_pg.cpp index 361c3b8d..77da3a18 100644 --- a/src/osd_peering_pg.cpp +++ b/src/osd_peering_pg.cpp @@ -108,7 +108,7 @@ void pg_obj_state_check_t::start_object() void pg_obj_state_check_t::handle_version() { - if (!target_ver && last_ver != list[list_pos].version && (n_stable > 0 || n_roles >= pg->pg_minsize)) + if (!target_ver && last_ver != list[list_pos].version && (n_stable > 0 || n_roles >= pg->pg_data_size)) { // Version is either stable or recoverable target_ver = last_ver; @@ -171,7 +171,7 @@ void pg_obj_state_check_t::handle_version() void pg_obj_state_check_t::finish_object() { - if (!target_ver && (n_stable > 0 || n_roles >= pg->pg_minsize)) + if (!target_ver && (n_stable > 0 || n_roles >= pg->pg_data_size)) { // Version is either stable or recoverable target_ver = last_ver; @@ -233,7 +233,7 @@ void pg_obj_state_check_t::finish_object() { return; } - if (!replicated && n_roles < pg->pg_minsize) + if (!replicated && n_roles < pg->pg_data_size) { if (log_level > 1) { diff --git a/src/osd_peering_pg.h b/src/osd_peering_pg.h index 4172ed35..6c5979cb 100644 --- a/src/osd_peering_pg.h +++ b/src/osd_peering_pg.h @@ -75,7 +75,7 @@ struct pg_t { int state = 0; uint64_t scheme = 0; - uint64_t pg_cursize = 0, pg_size = 0, pg_minsize = 0, parity_chunks = 0; + uint64_t pg_cursize = 0, pg_size = 0, pg_minsize = 0, pg_data_size = 0; pool_id_t pool_id = 0; pg_num_t pg_num = 0; uint64_t clean_count = 0, total_count = 0;