When a new leader acquires the lock, it will send out a lock acquired
notification along with periodic heartbeats. The get locker will attempt to
run immediately, but if a heartbeat arrives before it executes the heartbeat
will cancel the timer and reschedule it for the future. This process repeats
for each periodic heartbeat and the locker is never re-read from the OSD.
This is an issue only for namespace replayers due to the delayed fashion in
which the leader instance id is retrieved.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
std::scoped_lock locker{m_threads->timer_lock, m_lock};
if (is_leader(m_lock)) {
dout(5) << "got another leader heartbeat, ignoring" << dendl;
- } else {
+ } else if (!m_locker.cookie.empty()) {
cancel_timer_task();
m_acquire_attempts = 0;
schedule_acquire_leader_lock(1);