Skip to content

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

Merged
batrick merged 2 commits into
ceph:squidfrom
badone:wip-badone-squid-add-trim-to-ceph-bluestore-tool
Oct 20, 2026
Merged

batrick merged 2 commits into
ceph:squidfrom
badone:wip-badone-squid-add-trim-to-ceph-bluestore-tool

Conversation

@badone

@badone badone commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

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 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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@badone
badone requested review from a team as code owners September 17, 2026 01:03
@github-actions github-actions Bot added this to the squid milestone Sep 17, 2026
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.
@badone
badone force-pushed the wip-badone-squid-add-trim-to-ceph-bluestore-tool branch from fd3ac0d to 9e8c7d7 Compare September 17, 2026 01:04
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added releng-audit-fail Release engineering: failed backport verification audit. and removed releng-audit-fail Release engineering: failed backport verification audit. labels Sep 17, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 17, 2026
@badone
badone requested a review from YiteGu September 17, 2026 01:06
@badone

badone commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@aclamk FYI, as mentioned in #71603 (comment)

@badone

badone commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

/audit retest

@github-actions

Copy link
Copy Markdown

🔄 Audit Retest Triggered by @badone.

View workflow run

@github-actions github-actions Bot removed the releng-audit-fail Release engineering: failed backport verification audit. label Sep 22, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 22, 2026
@badone badone removed the releng-audit-fail Release engineering: failed backport verification audit. label Sep 22, 2026
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Sep 22, 2026
@badone

badone commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@batrick "No backport trackers found for main tracker #65877 (https://tracker.ceph.com/issues/65877) targeting base 'squid'" but there is? :(

@badone badone added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Sep 24, 2026
@badone

badone commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

/audit retest

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath29-testing-20261004.003333-squid.

@ronen-fr

ronen-fr commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@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).
Anyway - RADOS-approved (https://tracker.ceph.com/projects/rados/wiki/SQUID#httpstrackercephcomissues81392)

@YiteGu

YiteGu commented Oct 13, 2026

Copy link
Copy Markdown
Member

c266ef0
Does this patch also need to be backport?

@badone

badone commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

c266ef0 Does this patch also need to be backport?

@YiteGu and/or @ifed01 I've added that commit as you requested, please acknowledge and confirm, thank you.

@badone badone removed the releng-audit-fail Release engineering: failed backport verification audit. label Oct 16, 2026
@badone

badone commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test docs

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 16, 2026
@badone badone removed the releng-audit-fail Release engineering: failed backport verification audit. label Oct 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

⚠️ Multiple Original PRs Detected: PR #57369, PR #59762

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

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

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)

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.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 16, 2026
@ifed01

ifed01 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

c266ef0 Does this patch also need to be backport?

@YiteGu and/or @ifed01 I've added that commit as you requested, please acknowledge and confirm, thank you.

LGTM

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rzarzynski

Copy link
Copy Markdown
Contributor

/audit override

@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Oct 19, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @rzarzynski.

View workflow run

@batrick batrick modified the milestones: squid, v19.2.8 Oct 20, 2026
@batrick
batrick merged commit ce6023f into ceph:squid Oct 20, 2026
14 of 17 checks passed
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