@@ -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+
688701static int
689702mrone_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_
703717retry :
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