How to repair a missing container in Swift
I have a Swift install, part of a RHEL OS4 install. On this install I have a problem...
My problem is that for some objects the container for those objects is missing. I want to recreate those containers. This ought to be possible, as the information in the metadata for each opject contains the container.
What I did so far, on a storage node...
# find . -name "*.data" > /tmp/object
# while read f ; do swift-object-info $f ; done > /tmp/objectinfo< /tmp/objects
# grep Path /tmp/objectinfo | sed -e 's/Path: //' | sort > /tmp/objectpaths
This gave me a list of all exiting objects on our swift stack (not a lot at the moment). I then fed this in to swift-acount-audit:
# swift-account-audit -c1 -e /tmp/problempaths < /tmp/objectpaths
...
Accounts checked: 22
Containers checked: 35
Missing Replicas: 8
Objects checked: 218
Now this is a test environment, with only one device and replica count 1. I know this is not how it should be, right now, this is how it is. As you can see there are 8 containers missing.
Now, looking at hte swif-objectinfo output I see that the container name is stored in the metadata. So the information needed to recreate the containers. (and the .db files in them) does exist. But how do I do this? Is there some swift tool that I can use that basically crawls a directory structure with .data files and crecreates any missing container and account files?