rbd-mirror: allow incomplete demote snapshot to sync after rbd-mirror daemon restart
Currently when the rbd-mirror daemon on secondary was killed while a demote snapshot was newly created (0% copied)
or partially synced, the image's promotion state was set to **PROMOTION_STATE_ORPHAN** upon restart of rbd-mirror
daemon on secondary. This state prevents the demote snapshot sync after restart as bootstrap on secondary fails.
In this commit we fix this by assigning promotion state to **PROMOTION_STATE_NON_PRIMARY**
for an image with an **incomplete non-primary demote snapshot**.
The downside is that if the image is removed on the primary cluster, then after restart of
rbd-mirror daemon on secondary cluster, the corresponding image on the secondary also gets removed.
This is because deletion propagation is unconditionally enabled precisely for **PROMOTION_STATE_NON_PRIMARY**
images and this is okay since the user would have deleted the primary demoted image forcefully.
Fixes: https://tracker.ceph.com/issues/73528
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
(cherry picked from commit
636a3929c1a4052827660f44f35842ac62f6d69a)
Resolves: rhbz#
2416554