Repository navigation
squid: tools/bluestore: Add command 'trim' to ceph-bluestore-tool - #71850
Conversation
Add command 'trim' to ceph-bluestore-tool. Co-authored-by: Igor Fedotov <[email protected]> Signed-off-by: Yite Gu <[email protected]> (cherry picked from commit 0441dfc) Fixes: https://tracker.ceph.com/issues/80555 Conflicts: doc/man/8/ceph-bluestore-tool.rst src/os/bluestore/BlueFS.h src/os/bluestore/BlueStore.cc src/os/bluestore/BlueStore.h src/os/bluestore/bluestore_tool.cc Standard backport conflicts based around unexpected presence of zap-device functionality.
fd3ac0d to
9e8c7d7
Compare
|
@aclamk FYI, as mentioned in #71603 (comment) |
|
/audit retest |
|
🔄 Audit Retest Triggered by @badone. |
|
@batrick "No backport trackers found for main tracker #65877 (https://tracker.ceph.com/issues/65877) targeting base 'squid'" but there is? :( |
|
/audit retest |
|
This PR has been added to wip-bharath29-testing-20261004.003333-squid. |
|
@badone : the Rados suite found no related failures. On the other hand - there seems not be any test in the suite that was run, that actually exercised the new code you have added (unless I missed anything). |
|
c266ef0 |
Fixes: https://tracker.ceph.com/issues/67926 Signed-off-by: Igor Fedotov <[email protected]> (cherry picked from commit c266ef0)
|
jenkins test docs |
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Automated Redmine Linkage Audit
The following tracking irregularities were found:
- Closed/Resolved Backport Ticket: Backport tracker #68217 is already Resolved. Please reconcile.
- Mismatched PR Link: Backport tracker #68217 points to PR #59967, not this backport PR #71850.
Automated Backport Parity Review
Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.
Commit Parity Visualizer
| BACKPORT PR #71850 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| 9e8c7d7 tools/bluestore: Add command 'trim' to ceph-bluestore-tool | PR #57369 | 0441dfc tools/bluestore: Add command 'trim' to ceph-bluestore-tool |
| 48b1db8 tools/ceph-bluestore-tool: fix "--yes-i-really-really-mean-it" option | PR #59762 | c266ef0 tools/ceph-bluestore-tool: fix "--yes-i-really-really-mean-it" option |
| <<<< MISSING IN BACKPORT >>>> | c9c30bc tool/bluestore-tool: add zap_device command support | |
| <<<< MISSING IN BACKPORT >>>> | 1b431a3 tools/ceph-bluestore-tool: Allow show-label even if OSD is running | |
| <<<< MISSING IN BACKPORT >>>> | 1a80319 tools/ceph-bluestore-tool: remove param zap_size | |
| <<<< MISSING IN BACKPORT >>>> | afeaeb7 tools/ceph-bluestore-tool: Added zap-device documentation |
Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations
A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.
This does not necessarily indicate an issue but a maintainer should review.
**Click to expand conflict summaries.**
Deviation in Backport 9e8c7d7 (cherry-pick of 0441dfc)
Affected File(s)
doc/man/8/ceph-bluestore-tool.rstsrc/os/bluestore/BlueFS.hsrc/os/bluestore/BlueStore.ccsrc/os/bluestore/BlueStore.hsrc/os/bluestore/bluestore_tool.cc
Range Diff
Click to expand
--- Original (0441dfcd)
+++ Backport (9e8c7d79)
@@ -4,3 +4,15 @@
Co-authored-by: Igor Fedotov <[email protected]>
Signed-off-by: Yite Gu <[email protected]>
+(cherry picked from commit 0441dfcd883bd63d2b981164af5d491de46168be)
+
+Fixes: https://tracker.ceph.com/issues/80555
+
+ Conflicts:
+ doc/man/8/ceph-bluestore-tool.rst
+ src/os/bluestore/BlueFS.h
+ src/os/bluestore/BlueStore.cc
+ src/os/bluestore/BlueStore.h
+ src/os/bluestore/bluestore_tool.cc
+ Standard backport conflicts based around unexpected presence of
+ zap-device functionality.
================================================================================
RANGE DIFF
================================================================================
1: 0441dfcd883 ! 1: 9e8c7d796f9 tools/bluestore: Add command 'trim' to ceph-bluestore-tool
@@ Commit message
Co-authored-by: Igor Fedotov <[email protected]>
Signed-off-by: Yite Gu <[email protected]>
+ (cherry picked from commit 0441dfcd883bd63d2b981164af5d491de46168be)
+
+ Fixes: https://tracker.ceph.com/issues/80555
+
+ Conflicts:
+ doc/man/8/ceph-bluestore-tool.rst
+ src/os/bluestore/BlueFS.h
+ src/os/bluestore/BlueStore.cc
+ src/os/bluestore/BlueStore.h
+ src/os/bluestore/bluestore_tool.cc
+ Standard backport conflicts based around unexpected presence of
+ zap-device functionality.
## doc/man/8/ceph-bluestore-tool.rst ##
@@ doc/man/8/ceph-bluestore-tool.rst: Synopsis
- | **ceph-bluestore-tool** free-dump|free-score --path *osd path* [ --allocator block/bluefs-wal/bluefs-db/bluefs-slow ]
| **ceph-bluestore-tool** reshard --path *osd path* --sharding *new sharding* [ --sharding-ctrl *control string* ]
| **ceph-bluestore-tool** show-sharding --path *osd path*
+ | **ceph-bluestore-tool** zap-device --dev *dev path*
+| **ceph-bluestore-tool** trim --path *osd path*
Description
@@ doc/man/8/ceph-bluestore-tool.rst: Commands
- Show sharding that is currently applied to BlueStore's RocksDB.
+ Zeros all device label locations. This effectively makes device appear empty.
+:command: `trim` --path *osd path*
+
@@ src/os/bluestore/BlueFS.cc: size_t BlueFS::probe_alloc_avail(int dev, uint64_t a
## src/os/bluestore/BlueFS.h ##
@@ src/os/bluestore/BlueFS.h: public:
- }
uint64_t debug_get_dirty_seq(FileWriter *h);
bool debug_get_is_dev_dirty(FileWriter *h, uint8_t dev);
+ debug_point_t<std::function<void()>> unittest_inject_delay;
+ void trim_free_space(const std::string& type, std::ostream& outss);
private:
// Wrappers for BlockDevice::read(...) and BlockDevice::read_random(...)
## src/os/bluestore/BlueStore.cc ##
-@@ src/os/bluestore/BlueStore.cc: int BlueStore::dump_bluefs_sizes(ostream& out)
+@@ src/os/bluestore/BlueStore.cc: fail:
return r;
}
@@ src/os/bluestore/BlueStore.cc: int BlueStore::dump_bluefs_sizes(ostream& out)
## src/os/bluestore/BlueStore.h ##
@@ src/os/bluestore/BlueStore.h: public:
- std::string get_device_path(unsigned id);
int dump_bluefs_sizes(std::ostream& out);
+ static int zap_device(CephContext* cct, const std::string& dev);
+ void trim_free_space(const std::string& type, std::ostream& outss);
public:
@@ src/os/bluestore/bluestore_tool.cc: int main(int argc, char **argv)
+ string really;
int log_level = 30;
bool fsck_deep = false;
- po::options_description po_options("Options");
+ uint64_t disk_offset;
@@ src/os/bluestore/bluestore_tool.cc: int main(int argc, char **argv)
- ("key,k", po::value<string>(&key), "label metadata key name")
("value,v", po::value<string>(&value), "label metadata value")
("allocator", po::value<vector<string>>(&allocs_name), "allocator to inspect: 'block'/'bluefs-wal'/'bluefs-db'")
+ ("yes-i-really-really-mean-it", "additional confirmation for dangerous commands")
+ ("bdev-type", po::value<vector<string>>(&bdev_type), "bdev type to inspect: 'bdev-block'/'bdev-wal'/'bdev-db'")
+ ("really", po::value<string>(&really), "--yes-i-really-really-mean-it")
("sharding", po::value<string>(&new_sharding), "new sharding to apply")
("resharding-ctrl", po::value<string>(&resharding_ctrl), "gives control over resharding procedure details")
("op", po::value<string>(&action_aux),
@@ src/os/bluestore/bluestore_tool.cc: int main(int argc, char **argv)
- "free-fragmentation, "
"bluefs-stats, "
"reshard, "
-- "show-sharding")
-+ "show-sharding, "
-+ "trim")
+ "show-sharding, "
+- "zap-device"
+-)
++ "zap-device, "
++ "trim"
++ )
;
po::options_description po_all("All options");
po_all.add(po_options).add(po_positional);
@@ src/os/bluestore/bluestore_tool.cc: int main(int argc, char **argv)
if (action == "restore_cfb") {
#ifndef CEPH_BLUESTORE_TOOL_RESTORE_ALLOCATION
@@ src/os/bluestore/bluestore_tool.cc: int main(int argc, char **argv)
- exit(EXIT_FAILURE);
+ exit(EXIT_FAILURE);
+ }
}
- cout << sharding << std::endl;
+ } else if (action == "trim") {
+ BlueStore bluestore(cct.get(), path);
+ int r = bluestore.cold_open();How to proceed:
- Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git
Conflicts:block intact) and include an explanation for changes. - Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
- Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting
/audit override.
Be familiar with the rules and guidelines for writing backports.
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
|
/audit override |
|
✅ Audit Override Applied by @rzarzynski. |
This sneaked in with when backporting to squid. See #71850 Fixes: https://tracker.ceph.com/issues/81992 Signed-off-by: Igor Fedotov <[email protected]>
Add command 'trim' to ceph-bluestore-tool.
Co-authored-by: Igor Fedotov [email protected]
Signed-off-by: Yite Gu [email protected]
(cherry picked from commit 0441dfc)
Conflicts:
doc/man/8/ceph-bluestore-tool.rst
src/os/bluestore/BlueFS.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/bluestore/bluestore_tool.cc
Standard backport conflicts based around unexpected presence of
zap-device functionality.
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.