mirror of
https://github.com/ceph/ceph
synced 2024-12-21 10:54:42 +00:00
rbd-mirror: instance replayer now respects manual stop command
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
parent
53b87b9d22
commit
06e1244ee5
@ -309,6 +309,8 @@ void InstanceReplayer<I>::start_image_replayer(
|
||||
m_image_replayers.erase(image_replayer->get_global_image_id());
|
||||
image_replayer->destroy();
|
||||
return;
|
||||
} else if (m_manual_stop) {
|
||||
return;
|
||||
}
|
||||
|
||||
image_replayer->start(nullptr, false);
|
||||
|
@ -550,6 +550,14 @@ void PoolReplayer<I>::print_status(Formatter *f, stringstream *ss)
|
||||
f->dump_stream("peer") << m_peer;
|
||||
f->dump_string("instance_id", m_instance_watcher->get_instance_id());
|
||||
|
||||
std::string state("running");
|
||||
if (m_manual_stop) {
|
||||
state = "stopped (manual)";
|
||||
} else if (m_stopping) {
|
||||
state = "stopped";
|
||||
}
|
||||
f->dump_string("state", state);
|
||||
|
||||
std::string leader_instance_id;
|
||||
m_leader_watcher->get_leader_instance_id(&leader_instance_id);
|
||||
f->dump_string("leader_instance_id", leader_instance_id);
|
||||
@ -600,6 +608,7 @@ void PoolReplayer<I>::start()
|
||||
return;
|
||||
}
|
||||
|
||||
m_manual_stop = false;
|
||||
m_instance_replayer->start();
|
||||
}
|
||||
|
||||
@ -617,6 +626,7 @@ void PoolReplayer<I>::stop(bool manual)
|
||||
return;
|
||||
}
|
||||
|
||||
m_manual_stop = true;
|
||||
m_instance_replayer->stop();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user