Instead move the state to STATE_IDLE once the snapshot limits cannot be met
and move back to STATE_REPLAYING on a call from group_replayer to
set_remote_snap_id_end_limit()
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
auto limit = get_remote_snap_id_end_limit();
if (limit != CEPH_NOSNAP && limit >= m_remote_snap_id_end) {
copy_snapshots();
- } else {
- load_local_image_meta();
+ return;
+ }
+ dout(10) << "idling waiting for change in snapshot limits" << dendl;
+ {
+ std::unique_lock locker{m_lock};
+ ceph_assert(m_state == STATE_REPLAYING);
+ m_state = STATE_IDLE;
+ notify_status_updated();
}
}
return;
}
void set_remote_snap_id_end_limit(uint64_t snap_id) {
- std::unique_lock locker(m_lock);
- m_remote_group_image_snap_id = snap_id;
+ {
+ std::unique_lock locker(m_lock);
+ m_remote_group_image_snap_id = snap_id;
+ if (m_state != STATE_IDLE) {
+ return;
+ }
+ }
+ handle_image_update_notify();
}
uint64_t get_remote_snap_id_end_limit() {