Hi, all
I am using S3 api to access radosgw to put/get object. I found some issue about
ObjectCache::put implementation.
In radosgw implementation, it will do authorizing before reading the object.
During authorizing, it will get user object from .users pool. If the object is
not cache hit, it will send [getxattrs, stat] op and [read] op in two separate
and sequential ops. These two op will update radosgw cache both.
In the [read] op, when updating cache, it will check the flag if it contains
CACHE_FLAG_MODIFY_XATTRS and will clear CACHE_FLAG_META if not contains, just
as the code I pasted below. Thus it will cause CACHE_FLAG_META cleared because
info.flags passed in is CACHE_FLAG_DATA. It does not contain
CACHE_FLAG_MODIFY_XATTRS.
I have marked the code red.
void ObjectCache::put(string& name, ObjectCacheInfo& info)
{
……………...
if (info.flags & CACHE_FLAG_META)
target.meta = info.meta;
else if (!(info.flags & CACHE_FLAG_MODIFY_XATTRS))
target.flags &= ~CACHE_FLAG_META; // non-meta change should
reset meta
…………...
}
Then if I fetch the object using S3 API again, radosgw will get user object
from cache and find cache miss because flags mismatch. It need
(CACHE_FLAG_MODIFY_XATTRS|CACHE_FLAG_META), but the cached object flag is
(CACHE_FLAG_MODIFY_XATTRS|CACHE_FLAG_DATA) . It will cause radosgw submitting
op[getxattr,stat] again to get the same object.
I wonder why it will clear CACHE_FLAG_META and should we comment them since it
will cause another extra op.
Btw, The ceph version I am using is 0.67.7.
I am looking for your reply and thanks ahead.
Best regards.
Xinyi
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html