From 864690864f20012c1bbf2337a14a4c727b275a5d Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Wed, 25 Sep 2024 09:35:33 +0800 Subject: [PATCH] DAOS-16572 rebuild: properly assign global_dtx_resync_version in IV - b26 In rebuild_iv_ent_refresh() for refreshing DTX resync version, needs to assign rt_global_dtx_resync_version firstly before wakeup related rebuild_scan_leader. Signed-off-by: Fan Yong --- src/rebuild/rebuild_iv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rebuild/rebuild_iv.c b/src/rebuild/rebuild_iv.c index cc585e037e1..f4b9f75f407 100644 --- a/src/rebuild/rebuild_iv.c +++ b/src/rebuild/rebuild_iv.c @@ -167,6 +167,7 @@ rebuild_iv_ent_refresh(struct ds_iv_entry *entry, struct ds_iv_key *key, struct rebuild_tgt_pool_tracker *rpt; struct rebuild_iv *dst_iv = entry->iv_value.sg_iovs[0].iov_buf; struct rebuild_iv *src_iv = src->sg_iovs[0].iov_buf; + uint32_t old_ver; int rc = 0; rpt = rpt_lookup(src_iv->riv_pool_uuid, -1, src_iv->riv_ver, @@ -200,16 +201,18 @@ rebuild_iv_ent_refresh(struct ds_iv_entry *entry, struct ds_iv_key *key, dst_iv->riv_stable_epoch); rpt->rt_global_done = dst_iv->riv_global_done; rpt->rt_global_scan_done = dst_iv->riv_global_scan_done; - if (rpt->rt_global_dtx_resync_version < rpt->rt_rebuild_ver && + old_ver = rpt->rt_global_dtx_resync_version; + if (rpt->rt_global_dtx_resync_version < dst_iv->riv_global_dtx_resyc_version) + rpt->rt_global_dtx_resync_version = dst_iv->riv_global_dtx_resyc_version; + if (old_ver < rpt->rt_rebuild_ver && dst_iv->riv_global_dtx_resyc_version >= rpt->rt_rebuild_ver) { D_INFO(DF_UUID " global/iv/rebuild_ver %u/%u/%u signal wait cond\n", - DP_UUID(src_iv->riv_pool_uuid), rpt->rt_global_dtx_resync_version, + DP_UUID(src_iv->riv_pool_uuid), old_ver, dst_iv->riv_global_dtx_resyc_version, rpt->rt_rebuild_ver); ABT_mutex_lock(rpt->rt_lock); ABT_cond_signal(rpt->rt_global_dtx_wait_cond); ABT_mutex_unlock(rpt->rt_lock); } - rpt->rt_global_dtx_resync_version = dst_iv->riv_global_dtx_resyc_version; } out: