Repository navigation
nvmeofgw: introduce nvme-gw show-all - #67286
Conversation
a992234 to
fd66519
Compare
|
jenkins test make check |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
bill-scales
left a comment
There was a problem hiding this comment.
One query on the wording of the help text and a couple of minor nits, but functionally the code looks fine
| @@ -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, | |||
There was a problem hiding this comment.
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
| f->dump_unsigned("GW-epoch", map.gw_epoch[group_key]); | ||
| if (map.created_gws[group_key].size() == 0) { | ||
| f->close_section(); | ||
| f->flush(rdata); |
There was a problem hiding this comment.
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();
| @@ -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", | |||
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]>
a8c88a3 to
ca090f3
Compare
| } | ||
| } | ||
|
|
||
| bool NVMeofGwMon::nvme_gw_show_command(ceph::Formatter* f, bufferlist &rdata, const std::string &pool, |
There was a problem hiding this comment.
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.
| 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); |
|
jenkins test make check arm64 |
1 similar comment
|
jenkins test make check arm64 |
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
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.