Repository navigation
Conversation
knard38
changed the base branch from
master
to
ckochhof/dev/master/daos-19907/patch-001
December 3, 2026 15:00
knard38
changed the base branch from
ckochhof/dev/master/daos-19907/patch-001
to
master
December 3, 2026 15:01
Collaborator
|
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-19695/3/execution/node/1887/log |
dv_check_csum() verified each extent of an array value by reading its data back with a regular fetch by (major epoch, range). That read cannot tell apart extents written at the same major epoch, as the updates of a distributed transaction are, and returns the data of the later write for the part of the extent that it hides: healthy data was reported as corrupted (-DER_CSUM). Verify each listed extent with its own stored data instead, copied with vos_ioh_recx_copy(), hidden chunks included. Single values are not changed. Features: recovery Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
knard38
force-pushed
the
ckochhof/fix/master/daos-19912/patch-001
branch
from
December 4, 2026 19:31
659bcf9 to
1391fff
Compare
|
Ticket title is 'ddb: csum check reports -DER_CSUM on healthy extents overwritten at the same major epoch' |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
dv_check_csum()(added by #18941) verifies each extent of an array value by reading its data back with a regular fetch by (major epoch, range) and comparing the checksum recomputed from that data with the stored one. That read cannot tell apart extents written at the same major epoch, as the operations of a distributed transaction are: they only differ by their minor epoch, and for the part of an extent that a later write hides, the read returns the bytes of that write instead of the bytes the checksum was computed on. Intact data is then reported as corrupted (-DER_CSUM). The same holds for a punch. This was found in the review of #18941: #18941 (comment)Example from the review, with a record size of 1 and a chunk size of 4096, both writes at the same major epoch:
A = [0, 1024)at minor epoch 1, thenB = [0, 512)at minor epoch 3. The checksum-only fetch (VOS_OF_FETCH_CSUM) lists{0-511}(B) and{0-1023}(the whole of A, with its checksum). The re-read for the second entry returns the bytes of B on[0, 512)and those of A on[512, 1024), which do not match the checksum of A.This PR verifies each listed extent with its own stored data instead.
check_csum_recx()copies the whole extent of each entry of the checksum-only fetch withvos_ioh_recx_copy()(DAOS-19892, #19541) and recomputes the checksum from that copy, so every extent is checked against the bytes its checksums were computed on, hidden chunks included. Single values andcsum_dumpdo not change.dv_check_csum()has no caller outsideddb_testsyet. Thecsum_checkcommand that will expose it (#18942 for the C API, #18943 for Go) stays draft until this PR has landed, so no command reports the false mismatch.This PR builds on #19424 (DAOS-19907, test-only: the new test reuses its fixtures), which lands first. While it is not on master, Files changed also shows its commit.
Design
check_csum_recx()calls the newverify_extent_csum()for each entry of the list. It copies the whole extent of that entry withvos_ioh_recx_copy()into a buffer ofrx_nr * re_rec_sizebytes and verifies it against the checksum info listed at the same index. An extent that a later write splits is listed once per visible piece and verified once per entry, as before, and the buffer is as large as the extent, as before. The array path no longer nests avos_obj_fetch()inside the openVOS_OF_FETCH_CSUMhandle.verify_segment_csum()andfetch_check_value()are replaced by three helpers.verify_data_csum()recomputes the checksum of a buffer and compares it with the stored one, for both paths.verify_sv_csum()fetches a single value (its size, then its data, asfetch_check_value()did) and verifies it: the single-value path behaves as before.csum_data_size_check()keeps the check that a checksummed value or extent has data behind it, with its fault injection, socheck_csum_recx_inconsistent_testsstill covers arrays.dv_check_csum()states that every listed extent is verified in full, with its own data.Testing
One new
ddb_teststest,check_csum_recx_minor_tests, with seven cases that each calldv_check_csum()atDAOS_EPOCH_MAXand check the result in their own callback,check_csum_recx_minor_cb_001to_007(the case numbers below), ascheck_csum_recx_tests()does. The layouts are those of DAOS-19907: records of size 1, chunks ofC= 4096, extents ofS= 8192 records (two chunks), crc64, every extent written at major epoch 10 with its own checksum. The later write is aVOS_OF_REBUILDupdate at the same epoch: without a DTX handle it has a greater minor epoch than a regular update (EVT_REBUILD_MINOR_MINagainstVOS_SUB_OP_MAX), as the second operation of a transaction would. The callbacks check the range and the major epoch of each listed entry but not its minor epoch, which they do not receive yet (TODO DAOS-20080).HEAD(A=[0, S)thenB=[0, S/2), listed as{B, A}),MIDDLE(A=[0, 3C)thenB=[C, 2C), listed as{A, B, A}) andCHUNK(A=[0, S)thenB=[C/4, C/2), listed as{A, B, A}) over the range[0, 3C), asdump_csum_recx_minor_tests()does, then the range[C, 2C)ofHEAD, where onlyAis listed and verified as a whole. The result is 0 and no entry is reported.DVT_FAKE_MINOR_OID_BAD, one akey per layout, with the stored checksum of the first chunk of one extent corrupted:HEADwith A's hidden chunk corrupted,HEADwith B corrupted, andCHUNKwith A's partly hidden chunk corrupted. The result is-DER_CSUMand only the corrupted extent is reported, on each of its entries (twice for A inCHUNK); its recomputed checksum differs from the stored one only by the corrupted byte.HIDDENof DAOS-19907 (A hides B entirely) is not checked: A, the only extent listed, is entirely visible, so a re-read returns its own data and the case cannot fail without this change either. The example of the review is not a case of its own: there B hides a part of a chunk of A, as in case 3, at the head of A, as in case 1. A probe runs it as written in the review (below).write_minor()of DAOS-19907 can corrupt the stored checksum of one chunk, andg_oidsgains an eleventh object forDVT_FAKE_MINOR_OID_BAD.DVT_OID_COUNT(11) sizesg_oids, andDVT_TREE_OBJ_COUNT(10) keeps the tree thatdvt_insert_data()builds for the other tests, and thatls_cmd_testscounts, at 10 objects.Measured case by case (one process per case, since a failed case ends the test), with the
ddb_vos.cof master or of this change compiled into the test binary: with master, the 7 cases fail (cases 1 to 4 and 6 report a healthy extent, cases 5 and 7 recompute the checksum of the corrupted extent over the visible data instead of its own); with this change, the 7 pass. Copying entry 0 instead of the entry's own index inverify_extent_csum()fails 6 of the 7 cases (only case 4, a list with a single entry, survives), so the cases do pin the index. A scratch probe with the example of the review written in one DTX handle (minor epochs 1 and 3, as in the review) returns-DER_CSUMwith master (the whole of A,{0-1023}, is reported) and 0 with this change. The wholeddb_testspass (87 tests), also under valgrind (no error, nothing lost), as do the 25ddb_uttests, andgit-clang-formatis clean, also against the merge-base with master.Not covered: real transactions on an engine (the layouts are made through the VOS API), EC objects, checksum types other than crc64, and extents on NVMe (the pool of
ddb_testshas no data blob;vos_ioh_recx_copy()itself is tested on NVMe by VOS402.3, #19541). Punches: ddb has no punch-specific code, and the two VOS properties it relies on (a punched range is not listed, an extent partly hidden by a punch is listed and copied whole) are properties of VOS that this PR does not test; they belong in the VOS unit tests. No functional test reachesdv_check_csum()until thecsum_checkcommand is wired (#18942, #18943); the end-to-end functional test is DAOS-20152.Steps for the author:
After all prior steps are complete: