If a refresh is in-progress when a header update notification is
received, the notification was previously incorrectly dropped.
This prevented rbd-mirror's snapshot-based mirroring replayer from
detecting updates in some cases.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
ldout(cct, 20) << __func__ << ": refresh_seq = " << m_refresh_seq << ", "
<< "last_refresh = " << m_last_refresh << dendl;
- if (m_state == STATE_OPEN) {
- m_update_watchers->notify();
+ switch (m_state) {
+ case STATE_UNINITIALIZED:
+ case STATE_CLOSED:
+ case STATE_OPENING:
+ case STATE_CLOSING:
+ ldout(cct, 5) << "dropping update notification to watchers" << dendl;
+ return;
+ default:
+ break;
}
+
+ m_update_watchers->notify();
}
template <typename I>