Fix possible OSD crash during parallel read & write to an image with snapshots
OSDs could crash with the following "assertion failed" message (crash didn't affect data and was caused by OSD thinking upper blocks are full while they weren't). Reproduction without introducing artificial delays is hard because you have to force OSD to read an object with enqueued but not handled write which fills previously non-full bitmap. O_o. ``` vitastor-osd: ./src/osd/osd_primary_chain.cpp:613: void osd_t::send_chained_read_results(pg_t&, osd_op_t*): Assertion `stripes[role].read_buf' failed. ```
This commit is contained in:
@@ -993,7 +993,8 @@ int blockstore_impl_t::read_bitmap(object_id oid, uint64_t target_version, void
|
||||
{
|
||||
while (dirty_it->first.oid == oid)
|
||||
{
|
||||
if (target_version >= dirty_it->first.version)
|
||||
// Condition has to be the same as in dequeue_read()
|
||||
if (!IS_IN_FLIGHT(dirty_it->second.state) && target_version >= dirty_it->first.version)
|
||||
{
|
||||
if (result_version)
|
||||
*result_version = dirty_it->first.version;
|
||||
|
||||
Reference in New Issue
Block a user