Container cache management is racy
Bug #1715177 reported by
Thomas Herve
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I've noticed that the way Swift handles cache for container existence is prone to race conditions, if you have several operations in parallel.
Here's the reproducer I made: http://
It fails pretty consistenly on my devstack with default setting, swift master at 6da17e9.
Basically, a GET container concurrent to a PUT on that container can set the cache in memcache to NotFound, which means that later putting an object in that container will fail.
It's possible that I'm misusing something, or that maybe I shouldn't be using cache, but it feels like a bug.
Changed in swift: | |
status: | New → Opinion |
status: | Opinion → New |
To post a comment you must log in.
So, first of all, yes container existence is subject to cache race [1] - but it should work out most of the time generally because of the way we do an optimistic cache invalidation [2] and will always be correct eventually by design.
Honestly the provided script did not work for me, but even trying to modify it [3] I couldn't get it to reproduce any error in a single vm test environment - which makes me think the issue you're experiencing is related to a misconfiguration of the memcache ring for a multi-node environment [4].
I know first hand it can be a big jump to move from single node development/test environments into multi-node pre-production lab and staging environments, and readily admit there's probably lots of ways that we could improve the code and documentation. Perhaps jump in #openstack-swift on Freenode or shoot something out to the mailing list [5] and we can look more closely at what's going on!
1. see recheck_ container_ existence https:/ /docs.openstack .org/swift/ latest/ deployment_ guide.html# proxy-server & /github. com/openstack/ swift/blob/ 6da17e992375cba 37035527e69ef17 aa6a5d6f28/ swift/proxy/ controllers/ container. py#L180 /gist.github. com/clayg/ f5e03819315a886 c3c35bae6df5973 4d /docs.openstack .org/swift/ latest/ deployment_ guide.html# proxy-server & https:/ /github. com/openstack/ swift/blob/ master/ etc/memcache. conf-sample /wiki.openstack .org/wiki/ Mailing_ Lists#Operators
2. https:/
3. https:/
4. see memcache_servers https:/
5. https:/