Repository navigation
tools/rados: fail rmomapkey when the key does not exist - #73743
abrahamperz wants to merge 1 commit into
Conversation
omap_rm_keys() succeeds whether or not the key is present, so 'rados rmomapkey' printed nothing and exited 0 for a missing key. Look the key up first and report 'No such key' with a non-zero exit status, as getomapval already does. Fixes: https://tracker.ceph.com/issues/49020 Signed-off-by: Abraham Pérez <[email protected]>
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
|
Thanks @abrahamperz! Can you please make an account for yourself in https://tracker.ceph.com/ so we can assign the ticket to you? |
|
Thanks @ljflores! I actually already have a tracker account: username abrahamperz (same as my GitHub handle) |
|
This PR has been added to wip-bharath11-testing-20261114.052454-main. |
|
@abrahamperz Kindly address the PR check failure and proceed with merging the PR once the issue has been resolved. Should further QA validation be required, please re-add the |
|
jenkins test windows |
rados rmomapkeyprinted nothing and exited 0 when the key was not in the object's omap, becauseomap_rm_keys()succeeds whether or not the key is present. This change looks the key up withomap_get_vals_by_keys()first. A missing key now printsNo such key: <pool>/<obj>/<key>to stderr and exits 1, the same waygetomapvalreports it. A missing object still fails with ENOENT, as before.Changes:
src/tools/rados/rados.cc: check that the key exists before removing itqa/workunits/rados/test_rados_tool.sh:test_omapnow checks that removing an already removed key, or one that was never set, failsdoc/man/8/rados.rst: document the new failureVerified on a vstart cluster (1 mon, 1 memstore OSD):
rados -p rbtest rmomapkey obj waldoprinted nothing and exited 0No such key: rbtest/obj/waldoand exits 1; removing an existing key still exits 0, and so does removing one with--omap-key-filetest_omapfromtest_rados_tool.shpasses with the patched binaryThe existing qa callers of
rados rmomapkey(cephfs damage and scrub tests) remove keys that exist when they run, so they don't depend on the old behavior.Fixes: https://tracker.ceph.com/issues/49020
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.