How to repair a missing container in Swift

asked 2014-12-11 06:25:32 -0600

Krist gravatar image

updated 2014-12-12 17:59:31 -0600

smaffulli gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-14 18:31:25 -0600

zaitcev gravatar image

I don't know of a tool that can tinker container DBs behind the back of the servers. Of course you can write one using sqlite, but I didn't hear of a pre-existing one.

So, I would collect the container names from the metadata, save the objects, then re-create containers -- obviously they come up empty -- and re-upload those objects.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-12-11 06:25:32 -0600

Seen: 605 times

Last updated: Dec 14 '14