osd/PrimaryLogPG: Avoid accessing destroyed references in finish_degraded_object
As follows:
for (auto i = callbacks_for_degraded_object.begin(); i != callbacks_for_degraded_object.end();) {
finish_degraded_object((i++)->first);
}
void PrimaryLogPG::finish_degraded_object(const hobject_t oid)
{
if (callbacks_for_degraded_object.count(oid)) {
contexts.swap(callbacks_for_degraded_object[oid]);
callbacks_for_degraded_object.erase(oid); // Release
}
map<hobject_t, snapid_t>::iterator i = objects_blocked_on_degraded_snap.find(
oid.get_head()); // Access
...
}
Fixes: https://tracker.ceph.com/issues/41250
Signed-off-by: Tao Ning <ningtao@sangfor.com.cn>
(cherry picked from commit
86d55c1a0ddb48efc0c1934728d27f22cf49dfa1)
Conflicts:
src/osd/PrimaryLogPG.h
- retained "override" in nautilus
- PrimaryLogPG derives from PGBackend::Listener in nautilus, and its
PGBackend::Listener's only derived class. So we need to update
PGBackend::Listener accordingly. (quoted from Kefu's mimic backport)
NOTE: This is needed because
8a8947d2a32d6390cb17099398e7f2212660c9a1 went in
post-nautilus and is not being backported.