Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: FileStore:: optimize lfn_unlink #6649

Merged
merged 4 commits into from Jan 1, 2016

Conversation

majianpeng
Copy link
Member

If object didn't exist, the Index::lookup return 0 and set exist to
zero. So we should first check exist.

Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com

@xiaoxichen
Copy link
Contributor

seems in previous code if force_clear_omap = true, these two line will not be executed?

wbthrottle.clear_object(o); // should be only non-cache ref
fdcache.clear(o);

@majianpeng
Copy link
Member Author

In the original code, if force_clear_omap == true, it still call "wbthrottle.clear_object & fdcache.clear".
if object don't exist that is return ENOENT and force_clear_omap == true, it call "wbthrottle.clear_object & fdcache.clear". Or am i missing something?

@xiaoxichen
Copy link
Contributor

@tchaikov ....hmm...that part of code is hided....see line 497...Jianpeng is right....

@tchaikov
Copy link
Contributor

@majianpeng and @xiaoxichen , if force_clear_omap is true. and the object does not exist. as you mentioned, index->lookup(o, &path, &exist); returns 0, and resets exist. so before your change: the object is removed from the omap in this case. but with your change, the omap is not updated. i think this behaviour is changed, and is not expected. as omap might not be synced with the index. so we need to object_map->clear(o, &spos) as long as force_clear_omap is true. what do you think?

@majianpeng
Copy link
Member Author

@tchaikov .You are right. I'll update.

In _lookup, it already check object whether exists. So no need check
again in lookup func.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
…ion.

Origin:
virtual int lookup(
    const ghobject_t &oid, ///< [in] Object to lookup
    IndexedPath *path,     ///< [out] Path to object
    int *exist             ///< [out] True if the object exists,else false
    ) = 0;
Now:
virtual int lookup(
    const ghobject_t &oid, ///< [in] Object to lookup
    IndexedPath *path,     ///< [out] Path to object
    int *hardlink          ///< [out] hardlink for this objct. *hardlink=0 mean no-exist.
            ) = 0;

Change mean of last parameter, now using it indicate hardlinks(by
syscall(stat). If hardlink=0, mean file don't exist.
This for lfn_unlink when "force_clear_omap == false"(delete object
use this code path).

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
@tchaikov
Copy link
Contributor

apart from a nit, lgtm with a qa run.

@tchaikov
Copy link
Contributor

lgtm with a qa run.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
liewegas added a commit that referenced this pull request Jan 1, 2016
osd: FileStore:: optimize lfn_unlink

Reviewed-by: Kefu Chai <kchai@redhat.com>
@liewegas liewegas merged commit 2694e11 into ceph:master Jan 1, 2016
@ghost ghost changed the title os/FileStore:: optimize lfn_unlink. osd: FileStore:: optimize lfn_unlink Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants