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: filestore: fast abort if statfs encounters ENOENT #7703

Merged
merged 2 commits into from Mar 1, 2016

Conversation

xiexingguo
Copy link
Member

This is a supplement patch for #6869.

The original case is that if we remove the root directory of an OSD by accident or something alike, and the OSD is currently idle, the OSD process will be able to survive a long time before it does have some consumers to take it down, which may confuse other OSDs and decrease the reliability of the cluster.

This patch try to find out the above case as soon as possible, that is: if statfs to the basedir returned ENOENT, which means the file referred to by path does not exist any more, we abort quickly.
And also for other forgivable errors such as EINTR, we want update heartbeat peers normally.

Verified locally, and below is part of the result:

    -1> 2016-02-19 19:47:57.640730 7f69bebd7700  0 filestore(/home/xxg/ceph-0.94.5/src/dev/osd0)  path(/home/xxg/ceph-0.94.5/src/dev
/osd0) no longer exists, aborting...
     0> 2016-02-19 19:47:57.645429 7f69bebd7700 -1 os/FileStore.cc: In function 'virtual int FileStore::statfs(statfs*)' thread 7f69
bebd7700 time 2016-02-19 19:47:57.640781
os/FileStore.cc: 660: FAILED assert(0)

@@ -673,6 +673,8 @@ void OSDService::update_osd_stat(vector<int>& hb_peers)
int r = osd->store->statfs(&stbuf);
if (r < 0) {
derr << "statfs() failed: " << cpp_strerror(r) << dendl;
osd_stat.hb_in.swap(hb_peers);
osd_stat.hb_out.clear();
return;
Copy link
Member

Choose a reason for hiding this comment

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

better to just move the block below to before the statfs call

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

Fixed

@liewegas liewegas changed the title os/filestore: fast abort if statfs encounters ENOENT osd: filestore: fast abort if statfs encounters ENOENT Mar 1, 2016
liewegas added a commit that referenced this pull request Mar 1, 2016
osd: filestore: fast abort if statfs encounters ENOENT

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit ef59733 into ceph:master Mar 1, 2016
@xiexingguo xiexingguo deleted the xxg-wip-statfs branch March 1, 2016 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants