vitastor-disk: Fix stable/rollback handling in index_journal_by_object #127

Merged
vitalif merged 1 commits from koolkhel/vitastor:disk-meta-journal-keys into master 2026-11-17 23:36:22 +03:00

1 Commits

Author SHA1 Message Date
48d53ef69f vitastor-disk: Fix stable/rollback handling in index_journal_by_object
Some checks failed
Test / test_enospc_imm_xor (push) Has been cancelled
Test / test_old_enospc (push) Has been cancelled
Test / test_old_enospc_xor (push) Has been cancelled
Test / test_old_enospc_imm (push) Has been cancelled
Test / test_old_enospc_imm_xor (push) Has been cancelled
Test / test_scrub (push) Has been cancelled
Test / test_scrub_zero_osd_2 (push) Has been cancelled
Test / test_scrub_xor (push) Has been cancelled
Test / test_scrub_pg_size_3 (push) Has been cancelled
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Has been cancelled
Test / test_scrub_ec (push) Has been cancelled
Test / test_scrub_deleted_incomplete (push) Has been cancelled
Test / test_old_scrub (push) Has been cancelled
Test / test_old_scrub_zero_osd_2 (push) Has been cancelled
Test / test_old_scrub_xor (push) Has been cancelled
Test / test_old_scrub_pg_size_3 (push) Has been cancelled
Test / test_old_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Has been cancelled
Test / test_old_scrub_ec (push) Has been cancelled
Test / test_old_partwr_csum (push) Has been cancelled
Test / test_heal_old_csum_32k_dmj (push) Has been cancelled
Test / test_heal_old_csum_32k_dj (push) Has been cancelled
Test / test_heal_old_csum_32k (push) Has been cancelled
Test / test_heal_old_csum_4k_dmj (push) Has been cancelled
Test / test_heal_old_csum_4k_dj (push) Has been cancelled
Test / test_heal_old_csum_4k (push) Has been cancelled
Test / test_nfs (push) Has been cancelled
Test / test_nfs_unaligned_append (push) Has been cancelled
Test / test_nfs_long_readdir (push) Has been cancelled
Test / test_write_encrypted (push) Has been cancelled
Test / test_write_encrypted_ec (push) Has been cancelled
The "stable" and "rollback" branches read the "version" key, but
dump-journal writes the version as "ver". So both target versions were
always 0: "stable" marked every write of the object stable, and
"rollback" removed nothing. The rollback loop also counted down with a
size_t and "i >= 0", so it never ended and read before the vector.

Read "ver", and count down with an int as elsewhere in the code.

The function is only used to convert older metadata with its journal in
write_json_heap(), and write_json_meta() only calls write_json_heap()
for "3.0" metadata, so that path isn't reachable yet. There is no test
harness for vitastor-disk internals, so this comes without a test.
2026-11-17 21:13:02 +03:00