osd: Fail a chained read through an incomplete replicated object instead of aborting #170
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:chain-read-incomplete-parent"
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
When every copy of a replicated object has been dropped from its OSD set (each answered ENOENT: a chunk that answers ENOENT is erased from the set by
mark_object_corrupted(), unlike EIO/EDOM, which only setsLOC_CORRUPTED), the object is incomplete and itsread_targetholds no OSD, while the PG stays active (active+has_incomplete). A plain read of the object then answers EIO. A chained read (a clone or snapshot child) through it doesn't get that far: with the PG not exactlyPG_ACTIVEit skips the bitmap fast path, andcollect_bitmap_requests()hitsassert(read_target != 0)beforesubmit_chained_read_requests()reaches its ownOBJ_INCOMPLETEcheck. Asserts stay enabled in release builds, so the OSD aborts on the first such read, and on every one after its restart while the object stays that way.Peering never makes a replicated object incomplete, so it takes ENOENT answers that drop every copy: recovery or reads racing a delete (see #168 for the chained read part), or a store that lost the object.
Fix: fail the read with EIO there, as the EC branch of the same function already does when
extend_missing_stripes()fails.submit_bitmap_subops()returns the error andread_bitmaps()finishes the op with EIO.The test uses the fixture hunk of #167/#168 unchanged, so it doesn't conflict with them.
Tested: new
test_chained_read_through_incomplete_parentinosd_test: the parent object only on the primary, recovery gets ENOENT from it, the object is incomplete with an empty set and the PGactive+has_incomplete; a plain read of the parent and a chained read of the child must both answer EIO. Without the fix the OSD aborts onassert(read_target != 0); with it the wholeosd_testpasses.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA