Description of problem: When a versioned instance of an object has an instance identifier that begins with a hyphen, the rgw-bucket-restore-bucket-index does not restore that object and fellow instances properly. Version-Release number of selected component (if applicable): How reproducible: Very. Steps to Reproduce: 1. Create a versioned bucket. Add about 200 objects to it, each with two versions. 2. Capture the `radosgw-admin bi list ...` for that bucket. 3. Clear the bucket instance objects for that bucket using something like `rados clearomap ...` 4. Run `rgw-restore-bucket-index ...` on the bucket. 5. Capture the `radosgw-admin bi list ...` for that bucket again. 6. `diff` the two bi lists and look for versions appearing in the earlier but not the latter. Odds are that at least one of the instance identifiers began with a hyphen and anomalies will be seen with that object and fellow instances. Actual results: The bi lists don't have the same instances for all objects. Expected results: The bi lists should have the same instances for all objects. Additional info:
Please specify the severity of this bug. Severity is defined here: https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.
I've pasted in a script below. However, it depends on an upstream change that includes the layout "gen"eration information in `radosgw-admin bucket stats ...`. Since that change hasn't made it downstream yet, I think you can use `radosgw-admin bucket layout ...` in order to determin the "gen"eration. Basically it figures out what all of the bucket index objects would be for a given bucket and executes `rados clearomap -p default.rgw.buckets.index <bucket-index-objext>` on each. Oh, and in case it's not obvious, `jq` is the json query tool that I installed on my machine. Eric === #!/bin/bash temp1=/tmp/cli-1.$$ temp2=/tmp/cli-2.$$ pool="-p default.rgw.buckets.index" export PATH=${PATH}:$(pwd)/bin if [ $# -eq 1 ] ;then bucket=$1 else echo "Usage: $(basename $0) <bucket>" exit 1 fi radosgw-admin bucket stats --bucket=${bucket} >$temp1 2>/dev/null gen=$(jq -r '.index_generation' $temp1) num_shards=$(jq -r '.num_shards' $temp1) id=$(jq -r '.id' $temp1) if [ "$num_shards" -eq 0 ] ;then prefix=".dir.${id}$" elif [ "$gen" -eq 0 ] ;then prefix=".dir.${id}." else prefix=".dir.${id}.${gen}." fi echo prefix is $prefix # rados ls $pool objs=$(rados ls $pool 2>/dev/null | grep "^$prefix") set -x rados clearomap $pool $objs 2>/dev/null set +x rm -f $temp1 $temp2
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat Ceph Storage 7.0 Bug Fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:7780