]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librados: make querying pools for selfmanaged snaps reliable
authorIlya Dryomov <idryomov@gmail.com>
Wed, 22 Nov 2023 13:39:13 +0000 (14:39 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 29 Dec 2023 10:14:47 +0000 (11:14 +0100)
commit319ada6774d5e6f4fdf0b06eace63da7f82941b7
tree0a85e1b37c29fcaf912bae7d430d1de81a2e7c0a
parentfc884eed86906a7a55e1ac969b21754248668424
librados: make querying pools for selfmanaged snaps reliable

If get_pool_is_selfmanaged_snaps_mode() is invoked on a fresh RADOS
client instance that still lacks an osdmap, it returns false, same as
for "this pool is not in selfmanaged snaps mode".  The same happens if
the pool in question doesn't exist since the signature doesn't allow to
return an error.

The motivation for this API was to prevent users from running "rados
cppool" on a pool with unmanaged snapshots and deleting the original
thinking that they have a full copy.  Unfortunately, it's exactly
"rados cppool" that fell into this trap, so no warning is printed and
--yes-i-really-mean-it flag isn't enforced.

Fixes: https://tracker.ceph.com/issues/63607
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 0999e63bfbbee46b8e19c3f05881eee64dba8b5e)

Conflicts:
PendingReleaseNotes [ moved to >=16.2.15 section ]
PendingReleaseNotes
src/include/rados/librados.hpp
src/librados/RadosClient.cc
src/librados/RadosClient.h
src/librados/librados_cxx.cc
src/test/librados/snapshots_cxx.cc
src/tools/rados/rados.cc