swift-acount-audit does not work with policies

Bug #1484144 reported by Clément Contini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Confirmed
Low
Unassigned

Bug Description

The tool swift-account-audit is not able to find objects if they are in a container with a policy other than Policy-0. This is due to the tool only reading the ring file object.ring.gz instead of reading the proper file (object-X.ring.gz).

With a container with a policy:
root@test-swiftproxy03:~# curl -i -X HEAD -H "X-Auth-Token: $OS_AUTH_TOKEN" "http://172.16.21.154:8081/v1/AUTH_admin/montreal/"
HTTP/1.1 204 No Content
Content-Length: 0
X-Container-Object-Count: 500
Accept-Ranges: bytes
X-Storage-Policy: montreal
X-Container-Bytes-Used: 524288000
X-Timestamp: 1438790277.67927
Content-Type: text/plain; charset=utf-8
X-Trans-Id: txb2582db469fa4b2f8bc5e-0055cb594f
Date: Wed, 12 Aug 2015 14:33:51 GMT

Observed behavior:
root@test-swiftproxy03:~# swift-account-audit AUTH_admin/montreal
Auditing container "montreal"
Auditing account "AUTH_admin"
  Bad status HEADing object "/AUTH_admin/montreal/MONTREAL_345" on 172.16.21.211/xvdc1
[truncated]
  Bad status HEADing object "/AUTH_admin/montreal/MONTREAL_79" on 172.16.21.209/xvde1
  Failed fo fetch object /AUTH_admin/montreal/MONTREAL_79 at all!
  Bad status HEADing object "/AUTH_admin/montreal/MONTREAL_381" on 172.16.21.211/xvdb1
  Failed fo fetch object /AUTH_admin/montreal/MONTREAL_381 at all!
  Bad status HEADing object "/AUTH_admin/montreal/MONTREAL_386" on 172.16.21.212/xvdc1
  Failed fo fetch object /AUTH_admin/montreal/MONTREAL_386 at all!

  Accounts checked: 1

Containers checked: 1

   Objects checked: 500
  Missing Replicas: 1500

Expected behavior:
root@test-swiftproxy03:~# swift-account-audit AUTH_admin/montreal
Auditing container "montreal"
Auditing account "AUTH_admin"

  Accounts checked: 1

Containers checked: 1

   Objects checked: 500

Changed in swift:
assignee: nobody → Clément Contini (ccontini)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/212109

Changed in swift:
status: New → In Progress
clayg (clay-gerrard)
Changed in swift:
assignee: Clément Contini (ccontini) → nobody
status: In Progress → Confirmed
tags: added: low-hanging-fruit
Revision history for this message
Tim Burke (1-tim-z) wrote :

Related problem: swift-account-audit is cannot handle EC or encrypted data -- probably needs to learn about X-Object-Sysmeta-Ec-Etag and X-Object-Sysmeta-Container-Update-Override-Etag

Tim Burke (1-tim-z)
Changed in swift:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.