osd: Recalculate object state online when scrub finds its target version deleted #118

Merged
vitalif merged 2 commits from koolkhel/vitastor:scrub-deleted-repeer into master 2026-11-17 10:20:48 +03:00

2 Commits

Author SHA1 Message Date
e1f945f443 osd: Recalculate object state online when scrub finds its target version deleted
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
Peering left older pieces on their target OSDs out of the object state,
so an incomplete EC object with its newest version on one OSD only was
tracked with that piece alone. When vitastor-cli fix --check no removed
it, scrub found nothing and forgot the object: reads returned zeros in
place of the removed piece, and a write made them permanent, although
the previous version was still readable from the other OSDs.

List every OSD holding any version of the object in its state, once per
role. When scrub finds no piece of the target version but outdated
pieces are left, ask their OSDs for versions with SEC_READ_BMP and
recalculate the object state online: the newest version becomes the
target, older ones stay outdated, and pieces which are gone are dropped.
The object is forgotten only if nothing is left, and without the
unbalanced deref_object_state() it did before.
2026-11-16 20:25:57 +03:00
7a95269a05 osd: Keep pg_config history in sync when a write adds the current OSD set
The first write to a PG which isn't clean adds the current OSD set to
pg.target_history before the new history is reported to etcd. An etcd
event handled in between made apply_pg_config() compare it with the old
history in pg_config and stop the PG, so the PG was re-peered for
nothing. It happened on the first recovery write right after a PG state
report. Update the pg_config history at the same time, like peering
does when it clears the history of an active PG.
2026-11-16 20:25:57 +03:00