Skip to content

DAOS-17321 ddb: Add checksum check command to ddb GO code - #18943

Draft
knard38 wants to merge 1 commit into
ckochhof/dev/master/daos-17321/patch-007from
ckochhof/dev/master/daos-17321/patch-008
Draft

DAOS-17321 ddb: Add checksum check command to ddb GO code#18943
knard38 wants to merge 1 commit into
ckochhof/dev/master/daos-17321/patch-007from
ckochhof/dev/master/daos-17321/patch-008

Conversation

@knard38

@knard38 knard38 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Third and final patch in the 3-way split of #18940 ("DAOS-17321 ddb: add csum_check command to verify data checksums"):

  1. patch-006 — added dv_check_csum() to the ddb VOS API (ddb_vos.c/ddb_vos.h), with unit tests.
  2. patch-007 — added the ddb_run_csum_check() ddb C command on top of dv_check_csum(), with unit tests.
  3. This patch — wires ddb_run_csum_check() through to the ddb Go CLI as the csum_check command, with Go unit tests, and documents it (plus the previously undocumented csum_dump) in README.md.

Supersedes #18940. Mirrors the layering used for the sibling csum_dump command (#18685 in that earlier series), including the current build-tag CGo stub architecture (libddb.go/libddb_stubs.go, per-command ddb_run_<cmd>_Fn hooks) introduced by #18124. This patch completes the user-facing feature: after this lands, ddb csum_check is available from the shipped binary exactly as described in #18940.

Changes

csum_check command (ddb_commands.go)

Registers the command with:

  • path (required positional) — VOS tree path to check (must be complete: including the akey, and the extent for an array value).
  • -e, --epoch (default EPOCH_MAX) — for a single value akey, the epoch at or before which the value is fetched; for an array akey, the maximal epoch of the visible record extent(s) to select.
  • -v, --verbose (default false) — print every checksum entry (matching, no-checksum, or corrupted), not just corrupted ones, plus a final summary line even on success.

CsumCheck() on DdbContext (commands_wrapper.go)

Builds the C csum_check_options struct (path, epoch, verbose) and calls through to ddb_run_csum_check().

Real + stub ddb_run_csum_check() wrappers (libddb.go, libddb_stubs.go)

Follow the existing per-command _RC/_Fn hook pattern, so csum_check can be unit tested without a live VOS environment.

Tests (ddb_commands_test.go)

  • TestDdb_Cmds: missing required path argument, an invalid flag, the default epoch (EPOCH_MAX)/verbose (false), short -e/-v and long --epoch=/--verbose forms (individually and combined).
  • TestDdb_HelpCmds: csum_check's Usage: line, matching the existing convention used for every other command's help test.

Documentation (README.md)

Adds csum_check to the command reference table, alongside csum_dump (which had not yet been documented there).

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

@knard38 knard38 self-assigned this Aug 26, 2026
@knard38 knard38 added the CR Catastrophic Recovery Feature label Aug 26, 2026
@github-actions

Copy link
Copy Markdown

Ticket title is 'Checksum management with ddb'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-17321

Adds the Go-side command/flag definitions and cgo wrapper so
csum_check is available from the ddb binary, wired to
ddb_run_csum_check() from patch-007:

- ddb_commands.go: registers the csum_check command (required `path`
  positional, `-e/--epoch` default EPOCH_MAX, `-v/--verbose`).
- commands_wrapper.go: CsumCheck() on DdbContext builds the C
  csum_check_options struct and calls through to ddb_run_csum_check().
- libddb.go / libddb_stubs.go: real + stub ddb_run_csum_check()
  wrappers, following the existing per-command _RC/_Fn hook pattern so
  csum_check can be unit tested without a live VOS environment.
- ddb_commands_test.go: help text, missing/invalid argument handling,
  default/short/long epoch forms, and verbose short/long forms.

Also documents the new command (and the previously undocumented
csum_dump) in the ddb command reference (README.md).

This is patch 3/3 of the DAOS-17321 csum_check split (supersedes
PR #18940): see patch-006 for the ddb_vos dv_check_csum() API and
patch-007 for the ddb C command wiring. This completes the
user-facing `ddb csum_check` feature.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17321/patch-008 branch from cfe97a1 to 2ab1f05 Compare August 26, 2026 19:23
@daosbuild3

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CR Catastrophic Recovery Feature

Development

Successfully merging this pull request may close these issues.

3 participants