Skip to content

nvmeofgw: introduce nvme-gw show-all - #67286

Merged
leonidc merged 1 commit into
ceph:mainfrom
leonidc:nvme-gw-show-all
Jul 19, 2026
Merged

leonidc merged 1 commit into
ceph:mainfrom
leonidc:nvme-gw-show-all

Conversation

@leonidc

@leonidc leonidc commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor

Introduce a new read-only command, nvme-gw show-all, which iterates over all configured pools and groups and runs nvme-gw show for each, simplifying gateway inspection.

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.

@leonidc
leonidc requested a review from a team as a code owner February 10, 2026 10:15
@leonidc
leonidc requested a review from athanatos February 11, 2026 12:34
@leonidc
leonidc requested a review from baum March 8, 2026 09:25

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

@leonidc

leonidc commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@leonidc
leonidc requested a review from rzarzynski May 3, 2026 13:11
@caroav
caroav requested a review from bill-scales May 10, 2026 12:04

@bill-scales bill-scales 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.

One query on the wording of the help text and a couple of minor nits, but functionally the code looks fine

Comment thread src/mon/NVMeofGwMon.cc Outdated
@@ -425,6 +425,100 @@ bool NVMeofGwMon::prepare_update(MonOpRequestRef op)
}
}

bool NVMeofGwMon::nvme_gw_show_command(std::stringstream &sstrm, ceph::Formatter* f, bufferlist &rdata, const std::string &pool,

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.

nit: Its a bit strange to pass in sstrm when it is only used by this function to build the ana group list and is reset to an empty string afterwards by the callers to this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bill-scales , thanks , done

Comment thread src/mon/NVMeofGwMon.cc Outdated
f->dump_unsigned("GW-epoch", map.gw_epoch[group_key]);
if (map.created_gws[group_key].size() == 0) {
f->close_section();
f->flush(rdata);

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.

nit: I don't think you need the flush or the sstrm.str("") as these are both done by callers to this function afterwards. It might improve readability to restructure the code like:

if (map.created_gws[group_key.size() != 0) {
// ... code in else statement minus the last f->close_section()
}
f->close_section();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bill-scales , thanks , done

Comment thread src/mon/MonCommands.h Outdated
@@ -1453,6 +1453,10 @@ COMMAND("nvme-gw show"
" show nvmeof gateways within (pool, group)",
"mon", "r")

COMMAND("nvme-gw show-all",
" Dump nvmeof gateways for all pools groups",

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.

pools and groups?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bill-scales , thanks , done

Introduce a new read-only command, nvme-gw show-all, which
iterates over all configured pools and groups and runs
nvme-gw show for each, simplifying gateway inspection.

fixes https://tracker.ceph.com/issues/74854
Signed-off-by: Leonid Chernin <[email protected]>
@leonidc
leonidc force-pushed the nvme-gw-show-all branch from e0853fd to ca090f3 Compare June 1, 2026 09:02
@leonidc
leonidc force-pushed the nvme-gw-show-all branch 2 times, most recently from a8c88a3 to ca090f3 Compare June 4, 2026 05:27
Comment thread src/mon/NVMeofGwMon.cc
}
}

bool NVMeofGwMon::nvme_gw_show_command(ceph::Formatter* f, bufferlist &rdata, const std::string &pool,

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.

I would prefer to have a pure code shuffling separated from the rest of the changes.

I assume that nvme_gw_show_command() is nothing more than just dissected implementation of nvme-gw show.

Comment thread src/mon/NVMeofGwMon.cc
if (prefix == "nvme-gw show-all") {
f->open_array_section("gateways");
for (auto &[group_key, gws_states]:map.created_gws) {
nvme_gw_show_command(f.get(), rdata, group_key.first, group_key.second);

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.

OK.

@lee-j-sanders

Copy link
Copy Markdown
Member

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

1 similar comment
@caroav

caroav commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@leonidc
leonidc merged commit 1cdfb58 into ceph:main Jul 19, 2026
12 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.

8 participants