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

os/bluestore/BlueFS: do not start racing async compaction #11010

Merged
merged 1 commit into from Sep 8, 2016

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Sep 7, 2016

Compaction is triggred from sync_metadata. If one compaction is
in progress and another thread also calls sync_metadata, do not
trigger a second async compaction!

Signed-off-by: Sage Weil sage@redhat.com

Compaction is triggred from sync_metadata.  If one compaction is
in progress and another thread also calls sync_metadata, do not
trigger a second async compaction!

Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas
Copy link
Member Author

liewegas commented Sep 7, 2016

@somnathr

@somnathr
Copy link

somnathr commented Sep 7, 2016

Will try..

<< " ratio " << ratio
<< (log_flushing ? " (async compaction in progress)" : "")
<< dendl;
if (log_flushing ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Should we wait till the compaction finishes? Anyways we will not have enough work in compaction if we trigger also. May be we can wait till the old extents are released.

@liewegas
Copy link
Member Author

liewegas commented Sep 8, 2016

I think we can just skip it in this call path. We're only doing compaction in sync_metadata() because it's a convenient time to check (and maybe block). It's probably a bad place to do it, though.. we probably want a separate thread doing the compaction so we don't affect calling threads. That's a bigger change...

@varadakari
Copy link
Contributor

Agreed. we might have to get some throttling in place. We can have some naive algorithm to see how much we have to process or percentage to complete. So that we can make some decision recompact (if needed).

@liewegas liewegas merged commit c934402 into ceph:master Sep 8, 2016
@liewegas liewegas deleted the wip-bluefs-compaction-race branch September 8, 2016 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants