]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: do not keep ref of old osdmap in pg 7007/head
authorKefu Chai <kchai@redhat.com>
Mon, 21 Dec 2015 15:23:55 +0000 (23:23 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 22 Dec 2015 13:35:18 +0000 (21:35 +0800)
commit8978cd6fcf40076dbd944a2938b335d26c62b8d5
tree55401c6ec33d32bf13e9f71d081cf2b93beeef6f
parentaf44fe64c90822f30e0a7e99679d69d38c649120
osd: do not keep ref of old osdmap in pg

do not hold a strong reference to last_persisted_osdmap in PG. as an
OSD tries to trim previously persisted osdmaps, if they are not
referenced anymore. this helps to keep the meta collection in a
manageable size. if we advance the osdmap many times, and some PGs
are not impacted by these changes, it's very likely that they are
still holding very old osdmap references in their `last_persisted_osdmap_ref`.
this practically prevents the OSD from removing the out-dated osdmap
in OSD::handle_osd_map() if `last_persisted_osdmap_ref` is not updated
in a timely manner, for example, due to a large
"osd_pg_epoch_persisted_max_stale". so, instead of holding a reference
of last_persisted_osdmap, we can simply remember its epoch.

See also: #13990

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PG.cc
src/osd/PG.h