It is possible to set a bucket weight that is not the sum of the item
weights if you manually modify/build the CRUSH map. Protect against any
underflow on the bucket weight when removing items.
Signed-off-by: Sage Weil <sage@redhat.com>
On OSes where `python` is python3, dev mode's re-exec makes the
ceph tool fail. The standard way to fix this is by exporting
the PYTHON envvar pointing to the python2 interpreter.
Signed-off-by: Dave Anderson <dave@natulte.net>
This change adds to the python binding the support of:
- rados_lock_exclusive
- rados_lock_shared
- rados_unlock
http://tracker.ceph.com/issues/6114 Refs: #6114
Signed-off-by: Mehdi Abaakouk <sileht@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>
If calling clone_range and zero filled sections is at the ending of src
range, the target fd won't write zero filled sections. If target's
origin size shorter than needed, it will cause inconsistence between
two fd's desired range.
Signed-off-by: Haomai Wang <haomaiwang@gmail.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>
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>
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/10192Fixes: #10192
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>