Store v1: Roll back over a stable deletion instead of returning EBUSY #220

Merged
vitalif merged 1 commits from koolkhel/vitastor:v1-rollback-stable-delete into master 2026-12-02 10:47:38 +03:00
Contributor

Description

LIST shows nothing for an object whose newest stable entry is a deletion that has not been flushed yet (v1/impl.cpp:707-713). If an unstable write sits above that deletion, for example a recovery write that failed on other OSDs, peering sees only the unstable version and asks to roll the object back to 0 (osd_peering_pg.cpp:317,332).

dequeue_rollback() refuses to cross the stable deletion with -EBUSY ("Can't jump back over a stable version"). The flush fails, drops the connection to a remote OSD, and the PG re-peers and gets the same EBUSY. This repeats until the flusher gets to the deletion, which on a quiet OSD can take a long time, and a restart reloads the deletion as stable. Meanwhile every primary that sends such a rollback to that OSD drops its connection, so all the PGs they share re-peer too.

The fix: stop the rollback at a stable deletion instead of returning EBUSY. mark_rolled_back() already stops there, and journal replay goes through it, so the unstable versions above the deletion are dropped and the deletion stays. The new store behaves the same way: its delete has version 0, so its rollback never refuses over one. A stable write above the target is still refused.

Found: seen in a run. One OSD answered "Error while doing flush on OSD N: -16 (Device or resource busy)" at every peering of one PG, which kept re-peering for over an hour. Reproduced in test_blockstore_v1.

Tested: new test_rollback_over_stable_delete in test_blockstore_v1. It sets up a flushed v1, an unflushed stable delete v2 and an unstable v3; LIST shows 1 version, 0 stable.

  • Without the fix: aborts with rollback: -16.
  • With the fix:
    • rollback to 0 succeeds;
    • before and after a restart, v3 is gone, the deletion stays, LIST is empty and a read gives -ENOENT;
    • a stable v4 written over the deletion still makes the rollback return -EBUSY, and v4 still reads back.

Whole test_blockstore_v1 passes (42 tests), as do osd_test and test_blockstore_chaos (default 200 seeds).

Contributor Name

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

CLA

### Description LIST shows nothing for an object whose newest stable entry is a deletion that has not been flushed yet (`v1/impl.cpp:707-713`). If an unstable write sits above that deletion, for example a recovery write that failed on other OSDs, peering sees only the unstable version and asks to roll the object back to 0 (`osd_peering_pg.cpp:317,332`). `dequeue_rollback()` refuses to cross the stable deletion with -EBUSY ("Can't jump back over a stable version"). The flush fails, drops the connection to a remote OSD, and the PG re-peers and gets the same EBUSY. This repeats until the flusher gets to the deletion, which on a quiet OSD can take a long time, and a restart reloads the deletion as stable. Meanwhile every primary that sends such a rollback to that OSD drops its connection, so all the PGs they share re-peer too. The fix: stop the rollback at a stable deletion instead of returning EBUSY. `mark_rolled_back()` already stops there, and journal replay goes through it, so the unstable versions above the deletion are dropped and the deletion stays. The new store behaves the same way: its delete has version 0, so its rollback never refuses over one. A stable write above the target is still refused. Found: seen in a run. One OSD answered "Error while doing flush on OSD N: -16 (Device or resource busy)" at every peering of one PG, which kept re-peering for over an hour. Reproduced in test_blockstore_v1. Tested: new `test_rollback_over_stable_delete` in test_blockstore_v1. It sets up a flushed v1, an unflushed stable delete v2 and an unstable v3; LIST shows 1 version, 0 stable. - Without the fix: aborts with `rollback: -16`. - With the fix: - rollback to 0 succeeds; - before and after a restart, v3 is gone, the deletion stays, LIST is empty and a read gives -ENOENT; - a stable v4 written over the deletion still makes the rollback return -EBUSY, and v4 still reads back. Whole test_blockstore_v1 passes (42 tests), as do osd_test and test_blockstore_chaos (default 200 seeds). ### 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-12-02 01:52:15 +03:00
LIST shows nothing for an object with a stable, not yet flushed deletion,
so with an unstable write above it peering asks to roll the object back
to 0. That rollback failed with EBUSY, and the PG re-peered and failed
again in a loop until the flusher got to the deletion, which may take a
long time on an idle OSD and is not cleared by a restart.

Stop the rollback at a stable deletion, as mark_rolled_back() and the
new store already do. A stable write above the target is still refused.
vitalif merged commit f7793e37c1 into master 2026-12-02 10:47:38 +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#220
No description provided.