vitastor-disk: Write csum_block_size 0 in JE_START without data checksums #126

Merged
vitalif merged 1 commits from koolkhel/vitastor:write-journal-csum-block-size into master 2026-11-17 23:40:19 +03:00
Contributor

Description

With a manual layout, write-journal takes data_csum_type and csum_block_size from the JSON "start" entry and otherwise keeps the blockstore_disk_t defaults. calc_lengths(), which zeroes csum_block_size when there are no checksums, is not run for a manual layout. So a JSON without a "start" entry produced JE_START with data_csum_type none and csum_block_size 4096, and raw-resize then refused the journal: "journal header has different checksum parameters: none/4096 vs none/0".

Zero csum_block_size when there are no data checksums.

Tested: write-journal from a JSON without a "start" entry and without checksums, then raw-resize moving the journal. On master it fails with journal header has different checksum parameters: none/4096 vs none/0; with the fix it completes and the moved journal dumps the same entries. With --data_csum_type crc32c, or a "start" entry with crc32c/16k, JE_START is unchanged.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description With a manual layout, write-journal takes data_csum_type and csum_block_size from the JSON "start" entry and otherwise keeps the blockstore_disk_t defaults. calc_lengths(), which zeroes csum_block_size when there are no checksums, is not run for a manual layout. So a JSON without a "start" entry produced JE_START with data_csum_type none and csum_block_size 4096, and raw-resize then refused the journal: "journal header has different checksum parameters: none/4096 vs none/0". Zero csum_block_size when there are no data checksums. Tested: `write-journal` from a JSON without a "start" entry and without checksums, then `raw-resize` moving the journal. On master it fails with `journal header has different checksum parameters: none/4096 vs none/0`; with the fix it completes and the moved journal dumps the same entries. With `--data_csum_type crc32c`, or a "start" entry with crc32c/16k, JE_START is unchanged. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-11-17 21:13:31 +03:00
With a manual layout, write-journal takes data_csum_type and
csum_block_size from the JSON "start" entry and otherwise keeps the
blockstore_disk_t defaults. calc_lengths(), which zeroes csum_block_size
when there are no checksums, is not run for a manual layout. So a JSON
without a "start" entry produced JE_START with data_csum_type none and
csum_block_size 4096, and raw-resize then refused the journal: "journal
header has different checksum parameters: none/4096 vs none/0".

Zero csum_block_size when there are no data checksums.
vitalif merged commit 8582f82356 into master 2026-11-17 23:40:19 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#126
No description provided.