On 15/07/2013 23:53, Sage Weil wrote: > On Mon, 15 Jul 2013, Loic Dachary wrote: >> Hi Sage, >> >> You mentionned that there is code somewhere checking the fact that all references to an ObjectContext are gone and that replacing manual reference counting with shared_ptr should preserve this ( i.e. in relation to https://github.com/ceph/ceph/pull/414 "replace ObjectContext pointers with shared_ptr" ). However, I've not been able to find such code. Would you be so kind as to show me where it is ? >> >> Cheers > > It's in ReplicatedPG.cc: > > void ReplicatedPG::on_flushed() > { > assert(object_contexts.empty()); > } > > which is called from the Reset state of the PG peering state machine. It is still here: https://github.com/dachary/ceph/blob/1a7e390965e6b03f72360f016b2e7d852c455784/src/osd/ReplicatedPG.cc#L6659 and should be ok. Although the de-allocation happens after the last shared_ptr<> goes out of scope instead of being deleted by an explicit call to put_object_context, I believe it happens before on_flushed() is invoked at https://github.com/dachary/ceph/blob/1a7e390965e6b03f72360f016b2e7d852c455784/src/osd/PG.cc#L5225 I can't imagine a case where it would assert with the proposed patch. Cheers > > sage > -- Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Attachment:
signature.asc
Description: OpenPGP digital signature