Fix the copy_from operation to not remove the objects from the in_use list
until after the entire operation is complete. In particular, the racing
read was completing and removing the dest oid from the in-use list before
the copy-from completed. This keeps the model in sync with what the OSD
is actually doing.
If another new read started up, it would grab the previous value from the
model and expect to see that, but would instead see the updated value.
Signed-off-by: Sage Weil <sage@inktank.com>
context->update_object_full(oid, src_value);
context->update_object_version(oid, comp->get_version64());
}
- context->oid_in_use.erase(oid_src);
- context->oid_not_in_use.insert(oid_src);
- context->kick();
} else if (info->id == 1) {
// racing read
assert(comp_racing_read->is_complete());
assert(!version || comp_racing_read->get_version64() == version);
version = comp_racing_read->get_version64();
}
+ }
+ if (++done == 2) {
context->oid_in_use.erase(oid);
context->oid_not_in_use.insert(oid);
+ context->oid_in_use.erase(oid_src);
+ context->oid_not_in_use.insert(oid_src);
context->kick();
}
- ++done;
}
bool finished()