All of lore.kernel.org
 help / color / mirror / Atom feed
From: suxinyi <suxinyi@tsinghua.org.cn>
To: ceph-devel@vger.kernel.orgceph-devel@vger.kernel.org
Subject: Issue about ObjectCache::put method
Date: Wed, 7 May 2014 19:31:06 +0800 (CST)	[thread overview]
Message-ID: <10038971.893981399462266519.JavaMail.coremail@mailserver3> (raw)

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

                 reply	other threads:[~2014-05-07 12:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10038971.893981399462266519.JavaMail.coremail@mailserver3 \
    --to=suxinyi@tsinghua.org.cn \
    --cc=ceph-devel@vger.kernel.orgceph-devel \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.