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

hammer: librbd: request exclusive lock if current owner cannot execute op #12018

Merged
merged 1 commit into from Nov 23, 2016

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Nov 16, 2016

@trociny
Copy link
Contributor Author

trociny commented Nov 16, 2016

@dillaman I have temporary added a hack to test this feature (will be removed after the review).

Also, I am not very happy with my complete_request function: accessing AioCompletion members looks too hackish. May be you see a better option?

@@ -896,6 +896,8 @@ bool ImageWatcher::handle_payload(const FlattenPayload &payload,

bool ImageWatcher::handle_payload(const ResizePayload &payload,
C_NotifyAck *ack_ctx) {
return ImageWatcher::handle_payload(UnknownPayload(), ack_ctx);

Choose a reason for hiding this comment

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

I assume this is the hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, just for testing: make remote return -EOPNOTSUPP. It is not going to be committed.

@@ -113,6 +121,18 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type,
}

r = remote_request();
if (r == -EOPNOTSUPP && request_lock) {
AioCompletion *comp = aio_create_completion();
ictx->image_watcher->request_lock(boost::bind(&complete_request, _1),
Copy link

@dillaman dillaman Nov 16, 2016

Choose a reason for hiding this comment

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

Perhaps just use:

AioCompletion *comp = aio_create_completion();
comp->add_request();
comp->finish_adding_requests(ictx->cct);
ictx->image_watcher->request_lock(boost::bind(&AioCompletion::complete_request, _1, ictx->cct, 0));
ictx->owner_lock.put_read();
r = comp->wait_for_complete();
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dillaman It looks like it works! Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Except one issue -- noise in the log:

2016-11-16 15:27:20.087375 7f02db7fe700 -1 librbd::AioCompletion: completed invalid aio_type: 4

@dillaman May I update AioCompletion::complete not to log error for AIO_TYPE_NONE?

Choose a reason for hiding this comment

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

... or just add the new AIO type for request lock.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dillaman Is it worth adding a new type on hammer branch? Also, additionally I would need to call comp->init_time(...) to set the type. If you think it is ok, I can do this way though.

Copy link

@dillaman dillaman Nov 16, 2016

Choose a reason for hiding this comment

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

OK, in that case, it's not worth it. I'd say demote the error message to an ldout(cct, 0)

Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

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

@dillaman dillaman added this to the hammer milestone Nov 16, 2016
@dillaman dillaman changed the title [DNM] librbd: request exclusive lock if current owner cannot execute op [DNM] hammer: librbd: request exclusive lock if current owner cannot execute op Nov 16, 2016
This is a direct commit to hammer due to librbd code has evolved
significantly in the master.

Fixes: http://tracker.ceph.com/issues/17068
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@trociny trociny changed the title [DNM] hammer: librbd: request exclusive lock if current owner cannot execute op hammer: librbd: request exclusive lock if current owner cannot execute op Nov 16, 2016
@trociny
Copy link
Contributor Author

trociny commented Nov 16, 2016

@dillaman Updated.

@dillaman
Copy link

lgtm

@smithfarm smithfarm self-assigned this Nov 16, 2016
smithfarm added a commit that referenced this pull request Nov 18, 2016
…current owner cannot execute op

Reviewed-by: Nathan Cutler <ncutler@suse.com>
smithfarm added a commit that referenced this pull request Nov 20, 2016
…current owner cannot execute op

Reviewed-by: Nathan Cutler <ncutler@suse.com>
smithfarm added a commit that referenced this pull request Nov 21, 2016
…current owner cannot execute op

Reviewed-by: Nathan Cutler <ncutler@suse.com>
@smithfarm
Copy link
Contributor

smithfarm commented Nov 21, 2016

@trociny @dillaman This PR was included in this rbd suite: http://tracker.ceph.com/issues/17151#note-12

That run has two issues: the first (OSD suicide timeout) is not reproducible and looks like environmental noise. Then there is a reproducible qemu-iotests failure which matches http://tracker.ceph.com/issues/10773

Can you take a look? If you think the qemu-iotests failure is unrelated, I guess this PR could be merged?

smithfarm added a commit that referenced this pull request Nov 21, 2016
…current owner cannot execute op

Reviewed-by: Nathan Cutler <ncutler@suse.com>
@dillaman
Copy link

@smithfarm lgtm

@smithfarm smithfarm merged commit 3b226b8 into ceph:hammer Nov 23, 2016
shinobu-x pushed a commit to shinobu-x/ceph that referenced this pull request Mar 4, 2017
resend writes after pool loses full flag

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
(cherry picked from commit dbcf2e4)

Conflicts:
	src/osdc/Objecter.cc
	src/osdc/Objecter.h
shinobu-x pushed a commit to shinobu-x/ceph that referenced this pull request Mar 9, 2017
resend writes after pool loses full flag

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
(cherry picked from commit dbcf2e4)

Conflicts:
	src/osdc/Objecter.cc
	src/osdc/Objecter.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants