librbd: retry list_snap_orders() once instead of failing sort_snaps()
If snapshot listing races with snapshot creation, rbd group snap ls
may spuriously return an unsorted listing and internal fail_if_not_sorted=true
consumers may generate a spurious EINVAL error. This is because snap orders
are listed before snaps themselves and the "missing order for snap" check in
sort_snaps() is driven by the list of snaps.
This can be improved by grabbing snap order keys one more time, adding the newly
discovered snap orders to m_snap_orders and retrying instead of immediately failing the sort.
Fixes: https://tracker.ceph.com/issues/67984
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
(cherry picked from commit
3c21aec85e986f5206e83fcdcf5b1e0441b35f56)