Skip to content

Commit

Permalink
DAOS-16572 rebuild: properly assign global_dtx_resync_version in IV (#…
Browse files Browse the repository at this point in the history
…15185)

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 <[email protected]>
  • Loading branch information
Nasf-Fan authored Oct 8, 2024
1 parent 30d3811 commit 9211793
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rebuild/rebuild_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9211793

Please sign in to comment.