]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/OSDMonitor: check creating_pgs.last_scan_epoch instead when sending creates 17257/head
authorKefu Chai <kchai@redhat.com>
Fri, 25 Aug 2017 06:13:14 +0000 (14:13 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 25 Aug 2017 12:10:43 +0000 (20:10 +0800)
commitee16df858bc7ec243520f61dcc50d52adb200034
tree927c14060d20ea5d7cde85f6c09e8a6120dfb7ed
parente49332b6a8632ff8d6802582efe0db66049cfa34
mon/OSDMonitor: check creating_pgs.last_scan_epoch instead when sending creates

we cannot be sure that the creating_pgs_by_osd_epoch is in sync with
creating_pgs.pgs even if mapping.get_epoch() is less or equal to
creating_pgs_epoch. because, 1) the access to mapping.epoch is not
protected by lock, 2) even worse, the mapping might be not finished yet
when we are trying to send pg-creates to subscribers.

so instead of comparing creating_pgs_epoch with mapping's epoch, we
should compare it with creating_pgs.last_scan_epoch. the former is
updated once the creating_pgs_by_osd_epoch is updated with the latest
mapping's epoch and creating_pgs.pgs; the latter is updated with current
osdmap's epoch when creating_pgs is being updated with the inc osd map.
if we are using a creating_pgs_epoch in sync, creating_pgs_epoch should
be creating_pgs.last_scan_epoch + 1.

Fixes: http://tracker.ceph.com/issues/20785
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc