Skip to content

Commit

Permalink
DAOS-16647 object: encoding parity for single parity object rebuild
Browse files Browse the repository at this point in the history
If there is only single parity, then let's encode the parity during
rebuild.

If there are more than one parity shards, then

1 If rebuild enumerate can get other parity recxs from the other parity
shard, then encode the parity during rebuild.

2. Otherwise, let's do replication for parity rebuild, and rely on the
EC aggregation to encode, since the other parity only have replica
recxs, encoding within rebuild might confuse EC aggregation process.

Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
wangdi1 committed Oct 5, 2024
1 parent f2a6dc8 commit 930ebc7
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions src/object/srv_obj_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,23 +1174,23 @@ __migrate_fetch_update_parity(struct migrate_one *mrone, daos_handle_t oh,
}

static int
migrate_fetch_update_parity(struct migrate_one *mrone, daos_handle_t oh,
struct ds_cont_child *ds_cont)
migrate_fetch_update_parity_per_iod(struct migrate_one *mrone, daos_handle_t oh,
daos_iod_t *iods, daos_epoch_t **ephs, int iod_nr,
struct ds_cont_child *ds_cont)
{
int i;
int j;
int rc = 0;

/* If it is parity recxs from another replica, then let's encode it anyway */
for (i = 0; i < mrone->mo_iods_num_from_parity; i++) {
for (j = 0; j < mrone->mo_iods_from_parity[i].iod_nr; j++) {
daos_iod_t iod = mrone->mo_iods_from_parity[i];
for (i = 0; i < iod_nr; i++) {
for (j = 0; j < iods[i].iod_nr; j++) {
daos_iod_t iod = iods[i];
daos_epoch_t fetch_eph;
daos_epoch_t update_eph;
daos_epoch_t *update_eph_p;

iod.iod_nr = 1;
iod.iod_recxs = &mrone->mo_iods_from_parity[i].iod_recxs[j];
iod.iod_recxs = &iods[i].iod_recxs[j];
/* If the epoch is higher than EC aggregate boundary, then
* it should use stable epoch to fetch the data, since
* the data could be aggregated independently on parity
Expand All @@ -1206,26 +1206,55 @@ migrate_fetch_update_parity(struct migrate_one *mrone, daos_handle_t oh,
* at the moment, so there should not be any vos aggregation
* impact this process as well.
*/
if (ds_cont->sc_ec_agg_eph_boundary >
mrone->mo_iods_update_ephs_from_parity[i][j])
if (ds_cont->sc_ec_agg_eph_boundary > ephs[i][j])
fetch_eph = min(ds_cont->sc_ec_agg_eph_boundary, mrone->mo_epoch);
else
fetch_eph = mrone->mo_iods_update_ephs_from_parity[i][j];
fetch_eph = ephs[i][j];

update_eph = mrone->mo_iods_update_ephs_from_parity[i][j];
update_eph_p = &update_eph;
update_eph_p = &ephs[i][j];
rc = __migrate_fetch_update_parity(mrone, oh, &iod, fetch_eph,
&update_eph_p, 1, ds_cont, true);
if (rc)
return rc;
}
}

return rc;
}

static int
migrate_fetch_update_parity(struct migrate_one *mrone, daos_handle_t oh,
struct ds_cont_child *ds_cont)
{
int rc = 0;

/* If it is parity recxs from another replica, then let's encode it anyway */
if (mrone->mo_iods_num_from_parity) {
rc = migrate_fetch_update_parity_per_iod(mrone, oh, mrone->mo_iods_from_parity,
mrone->mo_iods_update_ephs_from_parity,
mrone->mo_iods_num_from_parity, ds_cont);
if (rc)
return rc;
}

/* Otherwise, keep it as replicate recx */
if (mrone->mo_iod_num > 0) {
rc = __migrate_fetch_update_parity(mrone, oh, mrone->mo_iods, mrone->mo_epoch,
mrone->mo_iods_update_ephs,
mrone->mo_iod_num, ds_cont, false);
if (obj_ec_parity_tgt_nr(&mrone->mo_oca) > 1) {
/* If there are multiple parity shards, then let's not encoding the parity
* shard in this case, because the other parity may not encode as well, only
* encode the single parity may confuse the EC aggregation process.
*/
rc = __migrate_fetch_update_parity(mrone, oh, mrone->mo_iods,
mrone->mo_epoch,
mrone->mo_iods_update_ephs,
mrone->mo_iod_num, ds_cont, false);
} else {
rc = migrate_fetch_update_parity_per_iod(mrone, oh, mrone->mo_iods,
mrone->mo_iods_update_ephs,
mrone->mo_iod_num, ds_cont);
if (rc)
return rc;
}
}

return rc;
Expand Down

0 comments on commit 930ebc7

Please sign in to comment.