]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: retry list_snap_orders() once instead of failing sort_snaps() 64099/head
authorVinayBhaskar-V <vvarada@redhat.com>
Thu, 15 May 2025 14:18:30 +0000 (19:48 +0530)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 23 Jun 2025 07:26:40 +0000 (09:26 +0200)
commit433df92ff66bd0e7ebf3b8f66ddd9df43a8687d5
treee74e1054553ace449b0a1fdc9aaaa254f0d80347
parente01243e99c03d93e9e1597bce8d11d806a4cdfab
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)
src/librbd/group/ListSnapshotsRequest.cc
src/librbd/group/ListSnapshotsRequest.h