* Issue about ObjectCache::put method
@ 2014-05-07 11:31 suxinyi
0 siblings, 0 replies; only message in thread
From: suxinyi @ 2014-05-07 11:31 UTC (permalink / raw)
To: ceph-devel
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-07 12:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07 11:31 Issue about ObjectCache::put method suxinyi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.