qa/workunits/rbd: add a test for force promote with a user snapshot
Add a reproducer for the crash on a bad variant access which was fixed
in commit
7d75161051da ("librbd: fix a crash in get_rollback_snap_id").
The reproducer deliberately works around many other issues with force
promote in snapshot-based mirroring: stopping rbd-mirror daemon
shouldn't be necessary (let alone with SIGKILL), get_rollback_snap_id()
and its caller can_create_primary_snapshot() are flawed and can pick
the wrong snapshot to roll back to or skip rollback when it's actually
required, the user snapshot in this scenario should be removed as part
of force promoting because it's incomplete and won't be usable after
the image is promoted, etc.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
0f4a37dd9f28070d0d421379385a5f2912cc9627)
Conflicts:
qa/workunits/rbd/rbd_mirror.sh [ commit
3fdbc160bb21
("rbd-mirror: allow mirroring to a different namespace") not
in squid ]