Repository navigation
tools/bluestore: force discard when explicitly trimming free space - #72653
Conversation
|
jenkins test make check |
|
Fixes: 0441dfc ("tools/bluestore: Add command 'trim' to ceph-bluestore-tool") |
There was a problem hiding this comment.
LGTM!
I have created a tracker for this issue here: https://tracker.ceph.com/issues/82224. Please reference that in the PR and commit messages.
Since this issue has been since, #57369 - I would also recommend to add the following line:
Fixes: 0441dfc ("tools/bluestore: Add command 'trim' to ceph-bluestore-tool")
If possible, can we please also have some tests that verifies that this path is now working correctly ?
The trim command in ceph-bluestore-tool calls try_discard() with async=false when iterating over free extents in the BlueStore and BlueFS allocators. This selects synchronous discard, but does not bypass the bdev_enable_discard configuration setting. Since bdev_enable_discard defaults to false, explicitly invoking trim on a discard-capable device can iterate over all free extents without issuing any discard requests. The command nevertheless reports "trim done". This defeats the intended use case of performing an offline trim while leaving discard disabled during normal OSD operation. Pass force=true to try_discard() in both BlueStore::trim_free_space() and BlueFS::trim_free_space(). This allows explicit trim requests for the main block device and dedicated DB/WAL devices to bypass the online discard configuration setting while retaining synchronous execution and the device discard capability checks. The change does not modify the process configuration, persistent configuration, or the behavior of normal online discard operations. Existing handling of underlying discard errors remains unchanged. Fixes: https://tracker.ceph.com/issues/82224 Fixes: 0441dfc ("tools/bluestore: Add command 'trim' to ceph-bluestore-tool") Signed-off-by: Yite Gu <[email protected]>
a486635 to
4684e1b
Compare
thx, updated |
|
jenkins test make check arm64 |
|
This PR has been added to wip-bharath20-testing-20261109.055221-main. |
|
This PR has been added to wip-jaya-bs-testing-18-11-2026. |
The trim command in ceph-bluestore-tool calls try_discard() with async=false when iterating over free extents in the BlueStore and BlueFS allocators. This selects synchronous discard, but does not bypass the bdev_enable_discard configuration setting.
Since bdev_enable_discard defaults to false, explicitly invoking trim on a discard-capable device can iterate over all free extents without issuing any discard requests. The command nevertheless reports "trim done". This defeats the intended use case of performing an offline trim while leaving discard disabled during normal OSD operation.
Pass force=true to try_discard() in both BlueStore::trim_free_space() and BlueFS::trim_free_space(). This allows explicit trim requests for the main block device and dedicated DB/WAL devices to bypass the online discard configuration setting while retaining synchronous execution and the device discard capability checks.
The change does not modify the process configuration, persistent configuration, or the behavior of normal online discard operations. Existing handling of underlying discard errors remains unchanged.
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.