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

kraken: cephfs: ceph-fuse does not recover after lost connection to MDS #16105

Merged
merged 1 commit into from Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/cephfs/client-config-ref.rst
Expand Up @@ -152,6 +152,12 @@
:Type: Integer
:Default: ``131072`` (128KB)

``client_reconnect_stale``

:Description: Automatically reconnect stale session.
:Type: Boolean
:Default: ``false``

``client_snapdir``

:Description: Name for the snapshot directory.
Expand Down
12 changes: 10 additions & 2 deletions src/client/Client.cc
Expand Up @@ -12728,8 +12728,16 @@ void Client::ms_handle_remote_reset(Connection *con)
break;

case MetaSession::STATE_OPEN:
ldout(cct, 1) << "reset from mds we were open; mark session as stale" << dendl;
s->state = MetaSession::STATE_STALE;
{
const md_config_t *conf = cct->_conf;
if (conf->client_reconnect_stale) {
ldout(cct, 1) << "reset from mds we were open; close mds session for reconnect" << dendl;
_closed_mds_session(s);
} else {
ldout(cct, 1) << "reset from mds we were open; mark session as stale" << dendl;
s->state = MetaSession::STATE_STALE;
}
}
break;

case MetaSession::STATE_NEW:
Expand Down
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -406,6 +406,7 @@ OPTION(client_trace, OPT_STR, "")
OPTION(client_readahead_min, OPT_LONGLONG, 128*1024) // readahead at _least_ this much.
OPTION(client_readahead_max_bytes, OPT_LONGLONG, 0) // default unlimited
OPTION(client_readahead_max_periods, OPT_LONGLONG, 4) // as multiple of file layout period (object size * num stripes)
OPTION(client_reconnect_stale, OPT_BOOL, false) // automatically reconnect stale session
OPTION(client_snapdir, OPT_STR, ".snap")
OPTION(client_mountpoint, OPT_STR, "/")
OPTION(client_mount_uid, OPT_INT, -1)
Expand Down