Skip to content

rbd: When Ceph cluster becomes full, should allow user to remove rbd … - #12627

Merged
yuriw merged 3 commits into
ceph:masterfrom
liupan1111:wip-fix-remove-when-full
Mar 3, 2017
Merged

yuriw merged 3 commits into
ceph:masterfrom
liupan1111:wip-fix-remove-when-full

Conversation

@liupan1111

Copy link
Copy Markdown
Contributor

…and snapshot in order to release storage space.

Signed-off-by: Pan Liu [email protected]

@liupan1111

Copy link
Copy Markdown
Contributor Author

At this moment, the behavior is "hang the client".

Comment thread src/include/rados/librados.hpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it's a good idea to expose implementation to user. Maybe adding an interface for what you want is better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, will modify later, thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, thanks.

@liupan1111

Copy link
Copy Markdown
Contributor Author

@liewegas, @tchaikov, please help take a look, thanks!

Comment thread src/tools/rbd/Utils.h Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The parameter name of force doesn't really align (name-wise) with what it is actually doing behind the scenes which is to force-apply a special flag to the OSDs. Also, assuming there are no issues w/ the librados changes by others, I don't think this is the correct place to do this. Seems like you should be able to set this flag after opening the image for the remove actions so you don't need to put it in this common location.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@dillaman, Thank you for The review! I agree this change should better not be placed in Such a common place like init. I will modify it.

@dillaman dillaman added the core label Jan 10, 2017
@liupan1111

Copy link
Copy Markdown
Contributor Author

@dillaman, I've commit a new one, please help take a look.

@dillaman

Copy link
Copy Markdown

The rbd changes look good to me -- a member of the core team needs to evaluate the changes to librados and the OSDs.

Comment thread src/osd/PrimaryLogPG.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we want to touch the failsafe condition!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ops of deleting an image will be discarded here if don’t touch the failsafe condition

Comment thread src/include/rados/librados.hpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of exposing this, you can use the existing librados op flag:

src/include/rados/librados.hpp:    OPERATION_FULL_TRY           = LIBRADOS_OPERATION_FULL_TRY,

FULL_TRY makes the OSD assemble the transaction and proceed only if it does not result in a net increase in utilization. This should be true for deleting objects.

There's also a FORCE variant, but I don't think you should need it...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In “Objecter::_prepare_osd_op”, “CEPH_OSD_FLAG_FULL_FORCE” is set before sent op to an OSD, if “honor_osdmap_full” is false. When removing an image, several ops, like open, delete, watch, will be sent to the OSD, it’s difficult to set FULL_TRY flag for these ops one by one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, in that case, the FULL_TRY flag can be set in the same place as the FULL_FORCE flag: Objecter::_prepare_osd_op(). So you can add {set,unset}_osdmap_full_try(), and set the flag in one place, and then use that.

I really think we should use FULL_TRY unless we find there is some reason that can't work... if that's the case we have a bigger problem!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would still be far preferably to use the existing librados flags, though! Please try that appraoch first.. hopefully there is a central place wehre that can be done, or add an ImageCtx 'rados_flags' variable that is |'d in to every request.

@liewegas

liewegas commented Jan 17, 2017 via email

Copy link
Copy Markdown
Member

@liewegas

liewegas commented Jan 17, 2017 via email

Copy link
Copy Markdown
Member

@liupan1111

Copy link
Copy Markdown
Contributor Author

In that case, let's do one patch that rneames honor_osdmap_full to
set_full_force() (with opposite argument... false by default, true for
enable), and then another patch that adds a new set_full_try().

@liewegas, do you mean I need rename honor_osdmap_full or set_honor_osdmap_full()?

@liupan1111

Copy link
Copy Markdown
Contributor Author

@liewegas, this failsafe is not triggered by my modification... it will be called even without my changes...

@liupan1111

Copy link
Copy Markdown
Contributor Author

@liewegas Ping

@liupan1111

Copy link
Copy Markdown
Contributor Author

@liewegas, Could you help take a look? thanks.

@dillaman

Copy link
Copy Markdown

@liupan1111 I don't see any changes. I thought Sage was suggesting that you re-use the existing librados flag for allowing ops to proceed on full(?). Assuming that is the case, I think you would want to modify librbd to set the flag where needed when opening the image and set the flag on the individual ops issued on the remove / snap remove paths.

Comment thread src/tools/rbd/Utils.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Like @dillaman said, this should also be a more descriptive name... bool force_full_try probably

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, I will modify it.

@liupan1111

Copy link
Copy Markdown
Contributor Author

@dillaman @liewegas , I've modified as your comment, please help take a look. Thanks!

@liupan1111
liupan1111 requested a review from liewegas February 26, 2017 00:30

@dillaman dillaman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

rbd changes lgtm

@yuriw
yuriw merged commit c4c7bce into ceph:master Mar 3, 2017
@yuriw

yuriw commented Mar 3, 2017

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants