]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd/heartbeat: avoid racing when connecting to peer
authorKefu Chai <kchai@redhat.com>
Thu, 19 Sep 2019 08:06:05 +0000 (16:06 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 19 Sep 2019 10:23:20 +0000 (18:23 +0800)
commitb102c44291902bd070a2c7df9ae00143a9e8d36f
treefbf01f7c4f15b3f8577ea658e5390b735461b1e2
parentb82fd0320db96a1684a3a337839a45507ad11459
crimson/osd/heartbeat: avoid racing when connecting to peer

before this change, we could initialize connections to newly added peers
in parallel repeatly, if an OSD is listed in up/acting of multiple PGs
served by current OSD.

after this change, we try to add the peer to `Heartbeat.peers` first,
and then try to connect to it with the hb front/back addresses, to avoid
potential repeatly connecting to peer.

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