Merge pull request #24181 from dillaman/wip-36084

rbd-mirror: instantiate the status formatter before changing state

Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2018-09-20 22:26:11 +03:00 committed by GitHub
commit cd7f2fca17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -630,6 +630,9 @@ void ImageReplayer<I>::handle_start_replay(int r) {
return;
}
m_replay_status_formatter =
ReplayStatusFormatter<I>::create(m_remote_journaler, m_local_mirror_uuid);
Context *on_finish(nullptr);
{
Mutex::Locker locker(m_lock);
@ -641,8 +644,6 @@ void ImageReplayer<I>::handle_start_replay(int r) {
m_event_preprocessor = EventPreprocessor<I>::create(
*m_local_image_ctx, *m_remote_journaler, m_local_mirror_uuid,
&m_client_meta, m_threads->work_queue);
m_replay_status_formatter =
ReplayStatusFormatter<I>::create(m_remote_journaler, m_local_mirror_uuid);
update_mirror_image_status(true, boost::none);
reschedule_update_status_task(30);