From 0af74b8126e8da74853a34d59c365c1d1bb27da4 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 11 Feb 2021 15:54:01 -0500 Subject: [PATCH] librbd/mirror: leave non-primary snapshot images in creating state The creating state is a special case in rbd-mirror where it will automatically delete the image since it assumes it's malformed. A non-primary, snapshot-based mirror image needs to have at least one non-primary snapshot and the first one is not created until after replay has started. Now rbd-mirror will update the mirror image state to the enabled state after creating the first non-primary snapshot but before attempting the sync. Fixes: https://tracker.ceph.com/issues/49238 Signed-off-by: Jason Dillaman (cherry picked from commit 43f2c208fa3042d93e4810d804ffe28e9ca7af77) --- src/librbd/mirror/EnableRequest.cc | 2 +- src/librbd/mirror/EnableRequest.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librbd/mirror/EnableRequest.cc b/src/librbd/mirror/EnableRequest.cc index cd276fdfe852a..d564cbdc6abf7 100644 --- a/src/librbd/mirror/EnableRequest.cc +++ b/src/librbd/mirror/EnableRequest.cc @@ -284,7 +284,7 @@ void EnableRequest::handle_enable_non_primary_feature(int r) { return; } - image_state_update(); + finish(0); } template diff --git a/src/librbd/mirror/EnableRequest.h b/src/librbd/mirror/EnableRequest.h index 574dfe2bc03d0..a92b05cdf667b 100644 --- a/src/librbd/mirror/EnableRequest.h +++ b/src/librbd/mirror/EnableRequest.h @@ -67,7 +67,7 @@ private: * v (skip if not needed) * * ENABLE_NON_PRIMARY_FEATURE * * | * - * v * + * v (skip if not needed) * * IMAGE_STATE_UPDATE * * * * * * * | * * v * -- 2.39.5