]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: write image mirror status if state is CREATING 63050/head
authorN Balachandran <nithya.balachandran@ibm.com>
Wed, 30 Apr 2025 05:15:13 +0000 (10:45 +0530)
committerN Balachandran <nithya.balachandran@ibm.com>
Wed, 30 Apr 2025 05:18:15 +0000 (10:48 +0530)
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 <nithya.balachandran@ibm.com>
src/cls/rbd/cls_rbd.cc

index 7c0cd1f1266638e951ab1997f2fe2909a4723ab1..d534fa6621f4b4f91c25a1539ef0ea47407e478a 100644 (file)
@@ -5073,7 +5073,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;
   }