New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objectstore tool lookup by name & --op list filter #3020
Conversation
@dzafman this will make it significantly easier to use ceph_objectstore_tool for tests (test_repair.py etc.) |
repushed a version implementing what we discussed with one exception: I kept the object mapping because it turns out to be easy to keep. I changed it to return on error when there are multiple objects. I must confess that part of the reason for me to keep this is irrational (it is sometime difficult to let go of a piece of code ;-) and if you still think it would be better to remove it, I'll follow your advice. |
@dzafman added your changes and run in gitbuilder. Reviewed-by: from my point of view :-) |
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Abstract out the PG exploration loops and encapsulate the list-lost and fix-lost semantic in a callable object. Signed-off-by: Loic Dachary <ldachary@redhat.com>
If the object is not a parsable JSON string, assume an object name and look it up in all the PGs. If multiple objects have the same name, only apply the command to one of them. It is primarily useful in a test environment where the names of the tests objects are known and only a small number of objects exists. It replaces the following: path='--data-path dev/osd0 --journal-path dev/osd0.journal' for pgid in $(./ceph_objectstore_tool $path --op list-pgs) ; do object=$(./ceph_objectstore_tool $path --pgid $pgid --op list | grep '"oid":"NAME"') test -n "$object" && break done ./ceph_objectstore_tool $path --pgid $pgid "$object" remove with: ./ceph_objectstore_tool $path NAME remove http://tracker.ceph.com/issues/10192 Fixes: #10192 Signed-off-by: Loic Dachary <ldachary@redhat.com>
The positional object name is used to filter the output of --op list and only show the objects with a matching name. If both the object name and the pgid are omitted, all objects from all PGs are displayed. The output format is changed from {"oid":"GROUP","key":"","snapid":-2, "hash":2659194943,"max":0,"pool":0,"namespace":""} to [["0.7_head",{"oid":"GROUP","key":"","snapid":-2, "hash":2659194943,"max":0,"pool":0, "namespace":""}]] where the first member is the pgid where the object is found. Signed-off-by: Loic Dachary <ldachary@redhat.com>
The object format changed from {json object} to [pgid,{json object}] The parser is updated accordingly. If the --pgid is present, check that it equals the pgid from the object description. Signed-off-by: Loic Dachary <ldachary@redhat.com>
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
Instead of a parsable array make it easier to cut and paste listed objects Signed-off-by: David Zafman <dzafman@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
…y output Signed-off-by: David Zafman <dzafman@redhat.com>
Reviewed-by: David Zafman dzafman@redhat.com |
--pretty-format defaults true Add --format so xml output can be requested --op list defaults to single line of json per object To override this more human readable output use --pretty-format=false Add testing of --op list special handling Signed-off-by: David Zafman <dzafman@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
It isn't anticipated that anyone would use this but keeps backward compatible Signed-off-by: David Zafman <dzafman@redhat.com>
objectstore tool lookup by name & --op list filter Reviewed-by: David Zafman <dzafman@redhat.com> Reviewed-by: Loic Dachary <ldachary@redhat.com>
No description provided.