]> 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>
Mon, 4 Dec 2023 17:55:24 +0000 (18:55 +0100)
commit0999e63bfbbee46b8e19c3f05881eee64dba8b5e
tree46fd629ef7fd138775609d1b67703a36e044e5ef
parent54edc7955b0593423d2c03ca308b5e5fcdc528a3
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>
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