Skip to content

DAOS-18633 rebuild: global barrier for ec agg#17861

Closed
wangshilong wants to merge 5 commits intomasterfrom
shilongw/rebuild_ec_barrier
Closed

DAOS-18633 rebuild: global barrier for ec agg#17861
wangshilong wants to merge 5 commits intomasterfrom
shilongw/rebuild_ec_barrier

Conversation

@wangshilong
Copy link
Copy Markdown
Contributor

Pause EC agg globally before triggering rebuild and set rebuild fence after we confirmed all ec agg has been paused.

After rebuild, we don't need trigger full scan for ec agg any more, because we gurantee there is no ec aggregation after rebuild fence.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Errors are Unable to load ticket data
https://daosio.atlassian.net/browse/DAOS-18633

Pause EC agg globally before triggering rebuild and set rebuild fence
after we confirmed all ec agg has been paused.

After rebuild, we don't need trigger full scan for ec agg any more,
because we gurantee there is no ec aggregation after rebuild fence.

Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
@wangshilong wangshilong force-pushed the shilongw/rebuild_ec_barrier branch from 1be479b to af424f3 Compare April 1, 2026 15:04
Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
}

if (!dpc->spc_no_storage) {
dpc->spc_ec_agg_pause_gate = d_hlc_get();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of acquiring a new HLC, can't we use the 'rebuild version' (pool version) to identify this rebuild?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebuild_version is not safe, as retied might reuse same rebuild_version.

dpc->spc_ec_agg_pause_gate = d_hlc_get();
D_INFO(DF_RB ": set local EC agg pause gate token " DF_U64 "\n", DP_RB_RPT(rpt),
dpc->spc_ec_agg_pause_gate);
ds_cont_child_wait_ec_agg_pause(dpc, rebuild_wait_ec_pause);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to RPC timeout.

See agg_rate_ctl(), it should check the 'spc_ec_agg_pause_gate' as well? BTW, "rebuild_ver" looks a better name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem is we don't guarantee rebuild_ver always bump for retrying rebuild. I don't want to change that Semantics. Or I bump it locally to ensure it increase every time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding spc_ec_agg_pause_gate check to ds_pool_is_rebuilding() can make it affect agg_rate_ctl().

/* phase-2: broadcast scan RPC to all targets */
D_INFO(DF_RB ": start rebuild scan\n", DP_RB_RGT(*p_rgt));
rc = rebuild_scan_broadcast(pool, *p_rgt, &task->dst_tgts, task->dst_new_layout_version,
task->dst_rebuild_op, RB_SCAN_START);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we turned to use two rounds of scan broadcast, getting the global 'rebuild epoch' could be easier now, @liuxuezhao ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I also thought that, I can check some details, may push another PR or another commit to this PR later (will confirm with shilong which one is better).

rebuild_tgt_prepare_pause(crt_rpc_t *rpc, uint64_t *stable_epoch);

int
rebuild_tgt_cancel_pause(crt_rpc_t *rpc);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebuild_tgt_stop_agg()/rebuild_tgt_resume_agg() sounds more straightforward.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

} else {
D_ALLOC(snapshots, (cont->sc_snapshots_nr + 1) *
sizeof(daos_epoch_t));
D_ALLOC(snapshots, (cont->sc_snapshots_nr + 1) * sizeof(daos_epoch_t));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as rebuild_fence removed now, so looks need not + 1, for both L382 and 385

D_DEBUG(DB_MD, DF_UUID "[%d]: wait for pausing EC aggregation\n",
DP_UUID(pool_child->spc_uuid), dss_get_module_info()->dmi_tgt_id);
D_INFO(DF_UUID "[%d]: wait for local EC aggregation to pause\n",
DP_UUID(pool_child->spc_uuid), dss_get_module_info()->dmi_tgt_id);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to use INFO, then L976 can remove

dpc->spc_rebuild_end_hlc = d_hlc_get();
if (rpt->rt_ec_pause_token == dpc->spc_ec_agg_pause_gate) {
dpc->spc_ec_agg_pause_gate = 0;
dpc->spc_rebuild_end_hlc = d_hlc_get();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spc_rebuild_end_hlc is no usage now, looks fine to remove it also.

dpc->spc_ec_agg_pause_gate = d_hlc_get();
D_INFO(DF_RB ": set local EC agg pause gate token " DF_U64 "\n", DP_RB_RPT(rpt),
dpc->spc_ec_agg_pause_gate);
ds_cont_child_wait_ec_agg_pause(dpc, rebuild_wait_ec_pause);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding spc_ec_agg_pause_gate check to ds_pool_is_rebuilding() can make it affect agg_rate_ctl().

/* phase-2: broadcast scan RPC to all targets */
D_INFO(DF_RB ": start rebuild scan\n", DP_RB_RGT(*p_rgt));
rc = rebuild_scan_broadcast(pool, *p_rgt, &task->dst_tgts, task->dst_new_layout_version,
task->dst_rebuild_op, RB_SCAN_START);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I also thought that, I can check some details, may push another PR or another commit to this PR later (will confirm with shilong which one is better).

Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
liuxuezhao
liuxuezhao previously approved these changes Apr 3, 2026
Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
@wangshilong wangshilong marked this pull request as ready for review April 7, 2026 01:22
@wangshilong wangshilong requested review from a team as code owners April 7, 2026 01:22
@wangshilong wangshilong closed this Apr 8, 2026
@wangshilong
Copy link
Copy Markdown
Contributor Author

Replace by #17941

@wangshilong wangshilong deleted the shilongw/rebuild_ec_barrier branch April 8, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants