dark_data object audit watcher deletes not-dark object in sharded containers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
In Progress
|
Undecided
|
Unassigned |
Bug Description
The dark_data object audit watcher plugin uses a direct client to check if an object is in its container. The direct client container request will NOT return a complete object listing for a sharded container because the root container does not have object records. As a result, depending on its configured action, the dark_data watcher will erroneously report/
A client container listing request will still list the object, but download will obviously fail.
To reproduce in a SAIO environment:
Run a probe test to create a sharded container with a few objects:
nosetests ./test/
Use the shard-info tool to get the random container name that the probe test created
python swift/cli/
Restart swift services
swift-init restart main
List the container
swift list container-
Download the object - all OK :)
swift download container-
See the .data files on disk:
tree /srv/
Add dark_data watcher to object-server.conf (only in a disposable SAIO, do not do this on a cluster with data you care about):
emacs /etc/swift/
[object-
watchers = swift#dark_data
[object-
action=delete
Run the auditor:
swift-init object-auditor once
Take a look at the logs
journalctl -S -10m
Look for logs lines like:
Apr 21 13:45:12 saio object-6030[18795]: [audit-watcher swift#dark_data] deleting dark data /srv/node3/
See the .data files have gone :(
tree /srv/
Obj is still in listing
swift list container-
OOPS! Download the object...fails
swift download container-
Then seems like a problem will also happen when action=quarantine.