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

librbd: properly order concurrent updates to the object map #12420

Merged
merged 5 commits into from Dec 14, 2016

Conversation

dillaman
Copy link

@dillaman dillaman commented Dec 9, 2016

No description provided.

@trociny trociny self-assigned this Dec 11, 2016
trociny pushed a commit that referenced this pull request Dec 11, 2016
 librbd: properly order concurrent updates to the object map #12420
};

TEST_F(TestIOBlockGuard, NonDetainedOps) {
OpBlockGuard op_block_uard(m_cct);
Copy link
Contributor

@vshankar vshankar Dec 12, 2016

Choose a reason for hiding this comment

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

super minor: typo? op_block_guard?

Copy link
Author

Choose a reason for hiding this comment

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

@vshankar thx -- regex replace fail apparently

@@ -0,0 +1,272 @@
// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

@dillaman super minor (not worth to repush, may be a separate commit someday to fix all the affected files):
It should be 'mode:C++' (causes some troubles to me when editing these files in Emacs).

Also, while we are here, 'indent-tabs-mode:t' makes my Emacs to use tabs, while I see the tabs are converted to spaces after your edit. I like spaces more too, though this statement overrides my emacs config...

Copy link
Author

Choose a reason for hiding this comment

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

I'll fix it -- I always just copy-n-paste those from another file, so obviously there is some cleanup that needs to be done.


// alert the caller that the IO was detained
*cell = nullptr;
return 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

May be return block_operations.size() instead (might be useful for debugging, e.g could be printed in detained_aio_update)?
Also, your implementation does not return an error. Why declare this in the interface? It looks like it only adds unnecessary check in detained_aio_update.

Copy link
Author

Choose a reason for hiding this comment

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

I based this on another implementation in my image cache branch that actually can restrict the number of in-flight ops (returns -ENOMEM). I figured eventually the other (more complicated) version will come back, so I might as well support it now instead of having to fix it later.


Operation op3;
BlockGuardCell *cell3;
ASSERT_EQ(1, op_block_guard.detain({0, 2}, &op3, &cell3));
Copy link
Contributor

Choose a reason for hiding this comment

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

@dillaman needs updating

@@ -0,0 +1,98 @@
// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

And then this would be nice to fix too

Jason Dillaman added 5 commits December 13, 2016 16:57
Concurrent IO to the same object would previously result in the first
IO pausing to update the object map while the other IO would proceed
to directly update the object before the object map state was properly
updated.

Fixes: http://tracker.ceph.com/issues/16176
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
…ject

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman
Copy link
Author

@trociny done

@dillaman
Copy link
Author

retest this please

@trociny
Copy link
Contributor

trociny commented Dec 14, 2016

@ceph-jenkins retest this please

Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

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

LGTM

@trociny trociny merged commit 4828ab6 into ceph:master Dec 14, 2016
@dillaman dillaman deleted the wip-16176 branch December 14, 2016 17:33
smithfarm added a commit to smithfarm/ceph that referenced this pull request Aug 26, 2017
In master, the "batch update" change [1] was merged before
the "order concurrent updates" [2], while in jewel the latter
is already backported [3]. A partial backport of [1]
was attempted, but the automated cherry-pick missed some
parts of it which this commit is adding manually.

[1] ceph#11510
[2] ceph#12420
[3] ceph#12909

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
smithfarm added a commit to smithfarm/ceph that referenced this pull request Aug 26, 2017
In master, the "batch update" change [1] was merged before the "order
concurrent updates" [2], while in jewel the latter is already
backported [3]. A backport of [1] to jewel was attempted, and was
necessarily applied on top of [3] - i.e. in the reverse order compared
to how the commits went into master. This reverse ordering caused the
automated cherry-pick to miss some parts of [1] which this commit is
adding manually.

[1] ceph#11510
[2] ceph#12420
[3] ceph#12909

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants