Skip to content

Commit bc7d8ba

Browse files
committed
DAOS-18487 rebuild: retry fetch for zero iod_size with force degraded
Retry one more time if rebuild fetch get zero iod_size, with DIOF_FOR_FORCE_DEGRADE flag. Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
1 parent 7d40f64 commit bc7d8ba

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/object/srv_obj_migrate.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,27 @@ mrone_recx_vos2_daos(struct migrate_one *mrone, int shard, daos_iod_t *iods, int
685685
mrone_recx_daos_vos_internal(mrone, false, shard, iods, iods_num);
686686
}
687687

688+
static bool
689+
mrone_get_zero_iod_size(daos_iod_t *iods, int iod_num)
690+
{
691+
int i;
692+
693+
for (i = 0; i < iod_num; i++) {
694+
if (iods[i].iod_size == 0)
695+
return true;
696+
}
697+
698+
return false;
699+
}
700+
688701
static int
689702
mrone_obj_fetch_internal(struct migrate_one *mrone, daos_handle_t oh, d_sg_list_t *sgls,
690703
daos_iod_t *iods, int iod_num, daos_epoch_t eph, uint32_t flags,
691704
d_iov_t *csum_iov_fetch, struct migrate_pool_tls *tls)
692705
{
693706
uint32_t *extra_arg = NULL;
694707
int waited = 0;
708+
bool force_degraded = false;
695709
int rc;
696710

697711
/* pass rebuild epoch by extra_arg */
@@ -703,6 +717,14 @@ mrone_obj_fetch_internal(struct migrate_one *mrone, daos_handle_t oh, d_sg_list_
703717
retry:
704718
rc = dsc_obj_fetch(oh, eph, &mrone->mo_dkey, iod_num, iods, sgls, NULL, flags, extra_arg,
705719
csum_iov_fetch);
720+
if ((rc == 0 && mrone_get_zero_iod_size(iods, iod_num)) && !force_degraded &&
721+
!tls->mpt_fini) {
722+
DL_INFO(rc, DF_RB ": retry " DF_UOID " fetch", DP_RB_MPT(tls),
723+
DP_UOID(mrone->mo_oid));
724+
force_degraded = true;
725+
flags |= DIOF_FOR_FORCE_DEGRADE;
726+
goto retry;
727+
}
706728
if ((rc == -DER_TIMEDOUT || rc == -DER_FETCH_AGAIN || rc == -DER_NOMEM) &&
707729
tls->mpt_version + 1 >= tls->mpt_pool->spc_map_version) {
708730
if (tls->mpt_fini) {

0 commit comments

Comments
 (0)