DAOS-17321 ddb: Add checksum check function to ddb vos API - #18941
DAOS-17321 ddb: Add checksum check function to ddb vos API#18941knard38 wants to merge 1 commit into
Conversation
|
Ticket title is 'Checksum management with ddb' |
Adds dv_check_csum() to the ddb VOS API (ddb_vos.c/.h), mirroring the structure of the existing dv_dump_csum() (open container, build the iod from path, dispatch by value type, close container) as an independent implementation that additionally fetches the live data, recomputes its checksum(s), and compares against what was fetched. Results are reported through a callback with a got_csums array: got_csums[i] holds the recomputed checksum when entry i's stored checksum did not match, and is NULL when it matched or there was nothing to check. The function returns -DER_CSUM if any checksum entry fails to match. Test coverage: unit tests for dv_check_csum() (single value and array, matching/mismatching/no-checksum cases, and per-entry mismatch isolation when one of several overlapping array segments is corrupted), using extended VOS test fixtures (ddb_test_driver.c/.h) for corrupted single-value and array checksums. This is patch 1/3 of the DAOS-17321 csum_check split (supersedes PR #18940): see patch-007 for the ddb command wiring and patch-008 for the Go CLI/documentation. Features: recovery Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
243f712 to
d64d9da
Compare
|
Test stage Functional Cluster Box Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18941/1/execution/node/1599/log |
|
Test stage Functional Cluster Box Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18941/1/execution/node/1588/log |
|
Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18941/2/execution/node/1724/log |
|
Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18941/2/execution/node/1821/log |
|
Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-18941/2/execution/node/1874/log |
This patch is part of a 3-way split of #18940 ("DAOS-17321 ddb: add csum_check command to verify data checksums"), which was too large to review as a single PR. The split mirrors the layering already used for the sibling
csum_dumpfeature earlier in this same ticket (#18444 -> #18543 -> #18685):dv_check_csum()to the ddb VOS API (ddb_vos.c/ddb_vos.h), with unit tests.ddb_run_csum_check()into the ddb C command set on top ofdv_check_csum(). More details could be found in the draft PR DAOS-17321 ddb: Add checksum check command to ddb C API #18942.csum_checkthrough to the ddb Go CLI, plus documentation. More details could be found in the draft PR DAOS-17321 ddb: Add checksum check command to ddb GO code #18943.Supersedes #18940, which contained all three layers as a single squashed commit.
Changes
dv_check_csum()— new ddb VOS API function (ddb_vos.c,ddb_vos.h)dv_check_csum(daos_handle_t poh, struct dv_tree_path *path, daos_epoch_t epoch, dv_check_csum_cb check_cb, void *cb_arg)mirrors the structure of the existingdv_dump_csum()(open container, build the iod from path, dispatch by value type, close container), but additionally fetches the live data for each checksummed segment, recomputes its checksum(s) with a throwawaydaos_csummer, and compares the result against what was already fetched from disk. Nothing is modified — this is a read-only verification pass.Results are reported through a callback:
got_csumsis an array ofcil->dcl_csum_infos_nrpointers:got_csums[i]holds the checksum recomputed from the currently stored data when entryi's stored checksum did not match, and isNULLwhen it matched (or there was nothing to check) — sogot_csums[i] != NULLdoubles as the per-entry mismatch flag. The function itself returns-DER_CSUMif any entry failed to match, after invoking the callback with the full picture (so callers can report every mismatch, not just the first one).Internally,
check_csum_sv()/check_csum_recx()fetch the checksum metadata via the sameVOS_OF_FETCH_CSUMmechanism as the dump path, thenverify_segment_csum()fetches the live data for that segment (fetch_check_value()), recomputes its checksum, and compares it (daos_csummer_compare_csum_info()), snapshotting a standalone copy of the recomputed checksum (snapshot_csum_info()) on a mismatch so it outlives the throwaway csummer. For array akeys, all overlapping segments are checked independently — a corrupted segment doesn't stop verification of the others, andgot_csums[]correctly isolates which segment(s) failed.As a drive-by cleanup in the same file,
dump_csum_sv()/dump_csum_recx()had theircb_rc/rcdouble-bookkeeping simplified (no behavior change).Test fixtures (
tests/ddb_test_driver.c,tests/ddb_test_driver.h)Adds a third checksum test object (
g_oids[2]) with valid data but a deliberately corrupted stored checksum (single-byte flip applied to an otherwise-correct checksum before writing), for both the single-value and array-akey layouts:csum_test_corrupt_sv_setup()— one corrupted SV.csum_test_corrupt_recx_setup()— an array withDVT_FAKE_RECX_COUNToverlapping segments, onlyDVT_FAKE_RECX_BAD_IDXof which is corrupted, so per-entry isolation can be exercised (the other segment(s) must never be flagged).Tests (
tests/ddb_vos_tests.c)Three new test cases under the existing csum test suite:
check_csum_error_testsvos_cont_openfailure propagationcheck_csum_sv_testsEPOCH_MAX, corrupted csum (-DER_CSUM,got_csums[0]holds the recomputed value), no-callback no-op, callback-error propagationcheck_csum_recx_testsSteps for the author:
After all prior steps are complete: