mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
osd/OSD: maybe_share_map() use scope guard
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
This commit is contained in:
parent
c2aba692e7
commit
a936b581f5
@ -7293,27 +7293,29 @@ void OSDService::maybe_share_map(
|
|||||||
|
|
||||||
// assume the peer has the newer of the op's sent_epoch and what
|
// assume the peer has the newer of the op's sent_epoch and what
|
||||||
// we think we sent them.
|
// we think we sent them.
|
||||||
session->projected_epoch_lock.lock();
|
epoch_t send_from = 0;
|
||||||
if (peer_epoch_lb > session->projected_epoch) {
|
{
|
||||||
dout(10) << __func__ << " con " << con
|
std::lock_guard l(session->projected_epoch_lock);
|
||||||
<< " " << con->get_peer_addr()
|
|
||||||
<< " map epoch " << session->projected_epoch
|
|
||||||
<< " -> " << peer_epoch_lb << " (as per caller)" << dendl;
|
|
||||||
session->projected_epoch = peer_epoch_lb;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (osdmap->get_epoch() <= session->projected_epoch) {
|
if (peer_epoch_lb > session->projected_epoch) {
|
||||||
session->projected_epoch_lock.unlock();
|
dout(10) << __func__ << " con " << con
|
||||||
return;
|
<< " " << con->get_peer_addr()
|
||||||
}
|
<< " map epoch " << session->projected_epoch
|
||||||
|
<< " -> " << peer_epoch_lb << " (as per caller)" << dendl;
|
||||||
|
session->projected_epoch = peer_epoch_lb;
|
||||||
|
}
|
||||||
|
|
||||||
const epoch_t send_from = session->projected_epoch;
|
if (osdmap->get_epoch() <= session->projected_epoch) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
send_from = session->projected_epoch;
|
||||||
dout(10) << __func__ << " con " << con
|
dout(10) << __func__ << " con " << con
|
||||||
<< " " << con->get_peer_addr()
|
<< " " << con->get_peer_addr()
|
||||||
<< " map epoch " << session->projected_epoch
|
<< " map epoch " << session->projected_epoch
|
||||||
<< " -> " << osdmap->get_epoch() << " (shared)" << dendl;
|
<< " -> " << osdmap->get_epoch() << " (shared)" << dendl;
|
||||||
session->projected_epoch = osdmap->get_epoch();
|
session->projected_epoch = osdmap->get_epoch();
|
||||||
session->projected_epoch_lock.unlock();
|
}
|
||||||
send_incremental_map(send_from, con, osdmap);
|
send_incremental_map(send_from, con, osdmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user