Store v1: Roll back over a stable deletion instead of returning EBUSY #220
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:v1-rollback-stable-delete"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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_deletein test_blockstore_v1. It sets up a flushed v1, an unflushed stable delete v2 and an unstable v3; LIST shows 1 version, 0 stable.rollback: -16.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