Project

General

Profile

Feature #10192

ceph_objectstore_tool object lookup

Added by Loïc Dachary over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

100%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

It would be convenient for test purposes to have

ceph_objectstore_tool OBJECT remove

to be the equivalent of
for pgid in $(./ceph_objectstore_tool --data-path dev/osd0 --journal-path dev/osd0.journal --op list-pgs) ; do object=$(./ceph_objectstore_tool --data-path dev/osd0 --journal-path dev/osd0.journal --pgid $pgid --op list | grep '"oid":"GROUP"') ; test -n "$object" && break ; done ; ./ceph_objectstore_tool --data-path dev/osd0 --journal-path dev/osd0.journal --pgid $pgid "$object" remove 

it would fail if more than one object is found by the same name.

Associated revisions

Revision 7c1165f9 (diff)
Added by Loic Dachary over 9 years ago

objectstore_tool: lookup objects by name

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

Revision 2f874fd3 (diff)
Added by Loic Dachary about 9 years ago

objectstore_tool: lookup objects by name

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 <>
(cherry picked from commit 7c1165f96391821c00cca1ac04b3433dbec6bb6e)

Conflicts:
src/tools/ceph_objectstore_tool.cc

History

#1 Updated by Loïc Dachary over 9 years ago

  • Status changed from 12 to Fix Under Review

#2 Updated by Loïc Dachary over 9 years ago

  • Status changed from Fix Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF