]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: fix rmsnap command
authorMatan Breizman <mbreizma@redhat.com>
Thu, 29 Feb 2024 14:46:31 +0000 (14:46 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 24 Mar 2024 12:05:30 +0000 (12:05 +0000)
```
There are 2 ways to remove pool snaps, rados tool or mon command (ceph osd pool rmsnap).
It seems that the monitor command is not reporting the actual removal via new_removed_snaps which is later proceed in OSDMap::apply_incremental.
This will result in a clone object leakage since the snap id won't be marked as purged (and won't be trimmed).
```

Fixes: https://tracker.ceph.com/issues/64646
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit f19ad233025957964559410e6697aa8a2a024bc1)

src/mon/OSDMonitor.cc

index 917e9c47d45e25e8b5f2426dfa53ccb020a30d01..23c4f2832b35fc0816e8ab6dc2fe2e568d42f982 100644 (file)
@@ -13084,6 +13084,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     if (sn) {
       pp->remove_snap(sn);
       pp->set_snap_epoch(pending_inc.epoch);
+      pending_inc.new_removed_snaps[pool].insert(sn);
       ss << "removed pool " << poolstr << " snap " << snapname;
     } else {
       ss << "already removed pool " << poolstr << " snap " << snapname;