Skip to content

DAOS-19260 control: Add capability to format storage of specific engine#18604

Open
tanabarr wants to merge 1 commit into
tanabarr/control-fmtreplace-rankfrom
tanabarr/control-fmt-engineindex
Open

DAOS-19260 control: Add capability to format storage of specific engine#18604
tanabarr wants to merge 1 commit into
tanabarr/control-fmtreplace-rankfrom
tanabarr/control-fmt-engineindex

Conversation

@tanabarr

@tanabarr tanabarr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Add optional engine_idx parameter to StorageFormatReq to allow formatting
storage for a specific engine instance rather than all engines on a host.

Features: control

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).

Features: control
Signed-off-by: Tom Nabarro <thomas.nabarro@hpe.com>
@tanabarr tanabarr requested review from a team as code owners July 2, 2026 11:50
@tanabarr tanabarr self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Ticket title is 'Allow format on specific engine instance'
Status is 'Open'
https://daosio.atlassian.net/browse/DAOS-19260

@tanabarr tanabarr requested review from kjacque, knard38 and mjmac July 2, 2026 11:51
@daosbuild3

Copy link
Copy Markdown
Collaborator

@knard38 knard38 left a comment

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.

If the engine-idx default-value issue I raised is confirmed, I think it should be fixed before landing. It would also be good to add unit test coverage for the new --engine-idx feature.

Comment on lines +131 to +136
req := &control.StorageFormatReq{
Reformat: cmd.Force,
Replace: cmd.Replace,
Rank: rank,
EngineIdx: cmd.EngineIdx,
}

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.

From my understanding, using cmd.EngineIdx without cmd.Rank defined and cmd.Replace true makes no sense and can even lead to some unexpected behaviour. If I am correct, the same kind of consistency checking done for cmd.Rank should be done for cmd.EngineIdx:

if cmd.EngineIdx != nil && cmd.Rank == nil {
    return errors.New("--engine-idx option is only valid when used with --rank")
}

}

// Filter instances if engine-idx is specified (MaxUint32 means all engines)
if req.EngineIdx != ^uint32(0) {

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.

From my understanding, the MaxUint32 sentinel for "no filter, format all engines" is only ever set in control.StorageFormat() (src/control/lib/control/storage.go), after convert.Types() runs. Any other code path (such as auto-format) that builds a ctlpb.StorageFormatReq directly gets the Go zero value (0) for EngineIdx, which this check reads as "filter to engine 0 only".

From my investigation, latest version of protoc support "optional" field. Sadly, the version used by DAOS seems to not support such feature. Then, one solution could be to add a bool field engine_idx_enabled to the proto message StorageFormatReq and to update the code in the following way:

Suggested change
if req.EngineIdx != ^uint32(0) {
if req.Replace && req.EngineIdxEnabled {

We could also keep the sentinel solution but we will have to fix all the code using this protoc struct and setting the replace field to true.

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