Skip to content

tools/bluestore: Add command 'trim' to ceph-bluestore-tool - #57369

Merged
aclamk merged 1 commit into
ceph:mainfrom
YiteGu:bluestore-offline-trim
Jul 9, 2024
Merged

aclamk merged 1 commit into
ceph:mainfrom
YiteGu:bluestore-offline-trim

Conversation

@YiteGu

@YiteGu YiteGu commented May 9, 2024 •

Copy link
Copy Markdown
Member

Add command 'trim' to ceph-bluestore-tool.

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

@YiteGu

YiteGu commented May 10, 2024

Copy link
Copy Markdown
Member Author

jenkins test api

Comment thread src/blk/BlockDevice.h Resolved
Comment thread src/blk/kernel/KernelDevice.h Resolved
Comment thread src/os/bluestore/bluestore_tool.cc Resolved
Comment thread src/os/bluestore/BlueStore.cc Resolved
@anthonyeleven

Copy link
Copy Markdown
Contributor

How confident are you that it's safe to attempt discard operations on all SSDs that users might have?

At the very least there should be a warning and a --yes-i-really-really-mean it factor.

@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch from 026edf4 to 3acafa2 Compare May 13, 2024 15:04
@YiteGu

YiteGu commented May 13, 2024

Copy link
Copy Markdown
Member Author

How confident are you that it's safe to attempt discard operations on all SSDs that users might have?

At the very least there should be a warning and a --yes-i-really-really-mean it factor.

I don't have full confidence, your suggestion is correct. What do you think? @ifed01

@ifed01

ifed01 commented May 13, 2024

Copy link
Copy Markdown
Contributor

How confident are you that it's safe to attempt discard operations on all SSDs that users might have?
At the very least there should be a warning and a --yes-i-really-really-mean it factor.

I don't have full confidence, your suggestion is correct. What do you think? @ifed01

Sounds good.

@anthonyeleven

Copy link
Copy Markdown
Contributor

I have SSDs in my fleet today that brick when a filesystem is mounted with the discard option and written to. A firmware update might help, but some of them are on LSI HBAs which confound firmware updates.

@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch 2 times, most recently from f152f5a to 4a75f5e Compare May 14, 2024 04:35
@YiteGu
YiteGu requested a review from ifed01 May 14, 2024 07:53
Comment thread src/os/bluestore/bluestore_tool.cc Resolved
Comment thread src/blk/kernel/KernelDevice.cc Resolved
@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch from 4a75f5e to fd84915 Compare May 14, 2024 13:53
Comment thread src/blk/BlockDevice.h Resolved
@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch from fd84915 to 85ac05a Compare May 14, 2024 16:34
@YiteGu

YiteGu commented May 14, 2024

Copy link
Copy Markdown
Member Author

jenkins test make check

@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch from 85ac05a to 82412fd Compare May 15, 2024 02:11
@YiteGu

YiteGu commented May 15, 2024

Copy link
Copy Markdown
Member Author

jenkins test api

@YiteGu
YiteGu requested a review from ifed01 May 15, 2024 06:11
Comment thread src/blk/BlockDevice.h Resolved
Comment thread src/os/bluestore/BlueStore.cc Resolved
Comment thread src/os/bluestore/BlueFS.cc Resolved
Comment thread src/os/bluestore/bluestore_tool.cc Resolved
Comment thread doc/man/8/ceph-bluestore-tool.rst Resolved
@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch 2 times, most recently from 5e3b5f7 to 1247b3f Compare May 15, 2024 17:27
Add command 'trim' to ceph-bluestore-tool.

Co-authored-by: Igor Fedotov <[email protected]>
Signed-off-by: Yite Gu <[email protected]>
@YiteGu
YiteGu force-pushed the bluestore-offline-trim branch from 1247b3f to 0441dfc Compare May 16, 2024 01:49
@YiteGu
YiteGu requested review from aclamk and anthonyeleven May 16, 2024 04:26
@mheler

mheler commented May 18, 2024 •

Copy link
Copy Markdown
Contributor

I implemented this PR in my lab to do offline trim.. Interesting observations. If the OSD is heavily fragmented, the trim command takes a long while to complete (two to three hours). If the OSD has low to no fragmentation, the trim command completes in minutes. This is on an all NVMe cluster by the way.

@YiteGu

YiteGu commented May 20, 2024

Copy link
Copy Markdown
Member Author

I implemented this PR in my lab to do offline trim.. Interesting observations. If the OSD is heavily fragmented, the trim command takes a long while to complete (two to three hours). If the OSD has low to no fragmentation, the trim command completes in minutes. This is on an all NVMe cluster by the way.

More fragments will require more time to iterate the AVL allocator nodes.

@aclamk
aclamk merged commit fe2bc06 into ceph:main Jul 9, 2024
@huv95

huv95 commented Jul 12, 2024

Copy link
Copy Markdown

When will I be able to try this feature in the new image? My 13 SSDs are waiting for it.

@YiteGu

YiteGu commented Jul 12, 2024

Copy link
Copy Markdown
Member Author

When will I be able to try this feature in the new image? My 13 SSDs are waiting for it.

It should be release in the squid version.
@aclamk Do we need to backport this feature to reef and quincy?

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.

7 participants