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: KeyValueStore: fix wrongly placed assert #7047

Merged
merged 3 commits into from Jan 18, 2016

Conversation

xiexingguo
Copy link
Member

At present it will not be able to dump the current opened fds when an EMFILE error has encountered.

Fixes: #14176
Signed-off-by: xie xingguo xie.xingguo@zte.com.cn

@liewegas
Copy link
Member

liewegas commented Jan 3, 2016

please rebase

Fixes: ceph#14178
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
At present it will not be able to dump the current opened fds when an EMFILE error has encountered.

Fixes: ceph#14176
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

rebased.

if (r < 0)
break;
unsigned ret = _do_transaction(**p, bt, handle);
assert(ret == 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't necessarily agree with making this an assert(). Either _do_transaction() should have a void return or it could potentially return an error in the future, So we should leave the code the way it was.

@dzafman
Copy link
Contributor

dzafman commented Jan 4, 2016

👍 besides the 1 commit.

@dzafman
Copy link
Contributor

dzafman commented Jan 5, 2016

Now that I looked at this again I see that both KeyValueStore::_do_transaction() and FileStore::_do_transaction() have the following as the last line:

'''
return 0; // FIXME count errors
'''

I don't think we are ever going to return an error or a count, so let's change both to void and remove the FIXME. And fix the corresponding _do_transactions(), of course.

As _do_transaction will never be able to return a negative result code.
It always return zero actually.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@dzafman
Copy link
Contributor

dzafman commented Jan 5, 2016

@xiexingguo Do you mind making the same _do_transaction() change in FileStore?

@xiexingguo
Copy link
Member Author

@dzafman I did make the same change in FileStore in another PR xiexingguo@2334e5d :-) Thank you for your reminder.

liewegas added a commit that referenced this pull request Jan 18, 2016
osd: KeyValueStore: fix wrongly placed assert

Reviewed-by: David Zafman <dzafman@redhat.com>
@liewegas liewegas merged commit 86d47bd into ceph:master Jan 18, 2016
@xiexingguo xiexingguo deleted the xxg-wip-14176 branch January 19, 2016 00:43
@ghost ghost changed the title KeyValueStore: fix wrongly placed assert osd: KeyValueStore: fix wrongly placed assert Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants