]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
OSD: OSDMapRef access by multiple threads is unsafe 27402/head
authorSage Weil <sage@redhat.com>
Fri, 5 Apr 2019 13:59:23 +0000 (08:59 -0500)
committerSage Weil <sage@redhat.com>
Fri, 5 Apr 2019 13:59:23 +0000 (08:59 -0500)
commited6bc9f624d7ae38f1ed52b7135dbc281bd87854
tree6b543c6ded25bcf6708f90134c2fd94f460f2bf7
parent0b7445d33a0e253b32105f3db9fd8b046df999f8
OSD: OSDMapRef access by multiple threads is unsafe

we update OSD::osdmap in OSD::_committed_osd_maps() which is executed
by objectstore's finisher thread. while PG::sched_scrub() is called
by OSD's sharded work queue's worker thread.and we push the osdmap
updates down to PGs OSD::consume_map() which is in turn called by
OSD::_committed_osd_maps() where osdmap is updated. so it does not big
deal if we are checking a stale CEPH_OSDMAP_NODEEP_SCRUB flag.
also this flag will be updated with the latest osdmap very soon.

Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Zengran Zhang <zhangzengran@sangfor.com.cn>
(cherry picked from commit 454c4cbae6b3363b80f52c7db5b6b7a5f3affd1a)

# Conflicts:
# src/osd/OSD.cc
 - trivial conflict from adjacent code in OSDService::shutdown()
src/osd/OSD.cc
src/osd/PG.cc