Skip to content

mon/OSDMonitor: Add force-remove-snap mon command#57548

Merged
Matan-B merged 1 commit intoceph:mainfrom
Matan-B:wip-matanb-force-remove-snap
Jul 30, 2024
Merged

mon/OSDMonitor: Add force-remove-snap mon command#57548
Matan-B merged 1 commit intoceph:mainfrom
Matan-B:wip-matanb-force-remove-snap

Conversation

@Matan-B
Copy link
Contributor

@Matan-B Matan-B commented May 19, 2024

     *  Forces removal of snapshots in the range of
     *  [lower_snapid_bound, upper_snapid_bound) on pool <pool>
     *  in order to cause OSDs to re-trim them.
     *  The command has two mutually exclusive variants:
     *  * Default: All the snapids in the given range which are not
     *    marked as purged in the Monitor will be removed. Mostly useful
     *    for cases in which the snapid is leaked in the client side.
     *    See: https://tracker.ceph.com/issues/64646

Fixes: https://tracker.ceph.com/issues/66122

Possibly Fixes: https://tracker.ceph.com/issues/64519


Remove all snapids in the range which are not marked as purged.

Useful for leaks such as: https://tracker.ceph.com/issues/64646

Example usage:

POOL_NAME         USED  OBJECTS  CLONES  COPIES
unique_pool_0    8 KiB        2       1       2

$ rados lssnap -p unique_pool_0
0 snaps

$ ceph osd pool force-remove-snap unique_pool_0 
force reremoving snap ids in the range of [1,2) from pool 2. reremoved snapids: 1

POOL_NAME         USED  OBJECTS  CLONES  COPIES
unique_pool_0    4 KiB        1       0       1 

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@Matan-B Matan-B requested a review from a team as a code owner May 19, 2024 13:35
@Matan-B Matan-B requested review from athanatos and rzarzynski May 19, 2024 13:38
```
     *  Forces removal of snapshots in the range of
     *  [lower_snapid_bound, upper_snapid_bound) on pool <pool>
     *  in order to cause OSDs to re-trim them.
     *  The command has two mutually exclusive variants:
     *  * Default: All the snapids in the given range which are not
     *    marked as purged in the Monitor will be removed. Mostly useful
     *    for cases in which the snapid is leaked in the client side.
     *    See: https://tracker.ceph.com/issues/64646
```

Fixes: https://tracker.ceph.com/issues/66122

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
@Matan-B Matan-B force-pushed the wip-matanb-force-remove-snap branch from 1f14b88 to 6855b04 Compare May 19, 2024 13:43
@Matan-B
Copy link
Contributor Author

Matan-B commented May 19, 2024

The PR here is taken out of #53545 (which was approved).
#53545 introduced two variations to the new command.
As the non default variation is not urgent, I'll introduce them one by one instead (With separate trackers).

@amathuria
Copy link
Contributor

@yuriw
Copy link
Contributor

yuriw commented Jul 25, 2024

jenkins test windows

@yuriw
Copy link
Contributor

yuriw commented Jul 25, 2024

@Matan-B pls merge when all checks passed
ref: https://tracker.ceph.com/issues/66955

@olliRJL
Copy link

olliRJL commented Aug 20, 2024

Is this getting backported to quincy? ...hoping so...

@Matan-B
Copy link
Contributor Author

Matan-B commented Aug 22, 2024

Is this getting backported to quincy? ...hoping so...

#59403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants