These can happen with split or with state changes due to reordering
results within the hash range requested. It's easy enough to filter
them out at this stage.
Backport: giant, firefly
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
(cherry picked from commit
e7cc6117adf653a4915fb7a75fac68f8fa0239ec)
# it doesn't necessarily make sense as they're hex, at least it makes
# the list repeatable and comparable
objects=$(rados ls -p rbd | grep $prefix | \
- sed -e 's/'$prefix'\.//' -e 's/^0*\([0-9a-f]\)/\1/' | sort)
+ sed -e 's/'$prefix'\.//' -e 's/^0*\([0-9a-f]\)/\1/' | sort -u)
echo $objects
}