From ea72e066df74086a7003fb1a3f39723356af4219 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Wed, 30 Apr 2025 10:45:13 +0530 Subject: [PATCH] rbd: write image mirror status if state is CREATING It can take upto 30s for the image mirror status to be written to rbd_mirroring on the secondary for a newly created image. This fix attempts to reduce the time by writing the status to rbd_mirroring even if the image state is set to CREATING. Fixes: https://tracker.ceph.com/issues/71138 Signed-off-by: N Balachandran (cherry picked from commit 25a8de9c3db8309387eed3502e781872bc1e035e) --- src/cls/rbd/cls_rbd.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 229f85d490958..57d441447c35c 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -5070,7 +5070,8 @@ int image_status_set(cls_method_context_t hctx, const string &global_image_id, if (r < 0) { return 0; } - if (mirror_image.state != cls::rbd::MIRROR_IMAGE_STATE_ENABLED) { + if (mirror_image.state != cls::rbd::MIRROR_IMAGE_STATE_ENABLED && + mirror_image.state != cls::rbd::MIRROR_IMAGE_STATE_CREATING) { return 0; } -- 2.39.5