Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions qa/tasks/cephfs/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,16 @@ def test_disallow_monitor_managed_snaps_for_fs_pools(self):
with self.assertRaises(CommandFailedError):
self.fs.rados(["mksnap", "snap2"], pool=self.fs.get_metadata_pool_name())

with self.assertRaises(CommandFailedError):
test_pool_name = self.fs.get_data_pool_name()
base_cmd = f'osd pool mksnap {test_pool_name} snap3'
self.run_cluster_cmd(base_cmd)

with self.assertRaises(CommandFailedError):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

test_pool_name = self.fs.get_metadata_pool_name()
base_cmd = f'osd pool mksnap {test_pool_name} snap4'
self.run_cluster_cmd(base_cmd)

def test_attaching_pools_with_snaps_to_fs_fails(self):
"""
Test that attempt to attach pool with snapshots to an fs fails
Expand Down
6 changes: 6 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13033,6 +13033,12 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
if (pp->snap_exists(snapname.c_str())) {
ss << "pool " << poolstr << " snap " << snapname << " already exists";
} else {
if (const auto& fsmap = mon.mdsmon()->get_fsmap(); fsmap.pool_in_use(pool)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the commit description:

Pool level snaps and mon managed snaps can't co-exist (...)

Isn't this a thinko? Per #47753 (comment) I started thinking it's about Pool level snaps and FS level snaps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes; this is about FS level snaps and Pool level snaps
its just the nomenclature that @gregsfortytwo has used to refer to it (AFAIUI)

but looks like the phrasing should be changed to FS level snaps and Pool level snaps can't coexist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phrasing changed to "Pool-level and fs-level snapshots ..."

dout(20) << "pool-level snapshots have been disabled for pools "
"attached to an fs - poolid:" << pool << dendl;
err = -EOPNOTSUPP;
goto reply;
}
pp->add_snap(snapname.c_str(), ceph_clock_now());
pp->set_snap_epoch(pending_inc.epoch);
ss << "created pool " << poolstr << " snap " << snapname;
Expand Down