Ask Your Question
0

count objects in account_stat

asked 2013-11-26 17:42:53 -0500

I found that when adding or deleting an object, the table container_stat will be updated by the TRIGGER ( https://github.com/openstack/swift/blob/master/swift/container/backend.py#L71 (https://github.com/openstack/swift/bl...) ). But I didn't find how account_stat is updated. In the similar place ( https://github.com/openstack/swift/blob/master/swift/account/backend.py#L83 (https://github.com/openstack/swift/bl...) ), there are also some TRIGGER responding with adding or deleting a container, not the case of updating a container. So when an object is upload, the container_stat will be updated automatically, but account_stat will not. How and when is account_stat updated in Swift?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2013-11-26 18:01:16 -0500

torgomatic gravatar image

The container updater does this asynchronously.

If it were synchronous, the account database would rapidly become a bottleneck for concurrent object uploads. That's why it's async.

edit flag offensive delete link more
0

answered 2013-11-26 18:17:18 -0500

Thanks, but I have a further question:

If I didn't run container-updater, the object count in "swift stat" should keep 0 (is it right?). But actually object count of account is updated from the second uploaded object. For example:

Uploading the 1st object, 'swift stat' says "object: 0, Bytes:0" Uploading the 2nd object, 'swift stat' says "object: 1, Bytes: (size of 1st object)" Uploading the 3rd object, 'swift stat' says "object: 2, Bytes: (size of 1st object and 2nd one)"

Is this normal?

edit flag offensive delete link more
0

answered 2013-11-27 02:30:38 -0500

Thanks Samuel Merritt, that solved my question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-11-26 17:42:53 -0500

Seen: 60 times

Last updated: Nov 27 '13