summaryrefslogtreecommitdiff
path: root/src/mds
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2012-01-16 10:16:23 -0800
committerSage Weil <sage.weil@dreamhost.com>2012-01-16 10:16:23 -0800
commitecd6dec6775127a97ec1327e91b5cad5fd5a9184 (patch)
treefc4e2d314c563ae241a683672df34f095091638e /src/mds
parent7f123de85d005d6d17115742d1683068525369da (diff)
parenta4642946b284c0b0fd85587e0c0b0bbf0ec4b0b4 (diff)
downloadceph-ecd6dec6775127a97ec1327e91b5cad5fd5a9184.tar.gz
Merge remote branch 'gh/master' into wip-op-data-mux
Conflicts: src/librados.cc src/objclass/class_api.cc src/rgw/rgw_rados.cc
Diffstat (limited to 'src/mds')
-rw-r--r--src/mds/MDCache.cc24
-rw-r--r--src/mds/MDCache.h8
-rw-r--r--src/mds/MDS.cc42
-rw-r--r--src/mds/MDS.h15
-rw-r--r--src/mds/Server.cc8
5 files changed, 26 insertions, 71 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 953a89e0d83..fb7fec66301 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -3393,8 +3393,8 @@ void MDCache::rejoin_send_rejoins()
/**
* rejoin_walk - build rejoin declarations for a subtree
*
- * @dir subtree root
- * @rejoin rejoin message
+ * @param dir subtree root
+ * @param rejoin rejoin message
*
* from a rejoining node:
* weak dirfrag
@@ -3739,8 +3739,8 @@ public:
/**
* parallel_fetch -- make a pass at fetching a bunch of paths in parallel
*
- * @pathmap - map of inodeno to full pathnames. we remove items from this map
- * as we discover we have them.
+ * @param pathmap map of inodeno to full pathnames. we remove items
+ * from this map as we discover we have them.
*
* returns true if there is work to do, false otherwise.
*/
@@ -6919,9 +6919,9 @@ CInode *MDCache::cache_traverse(const filepath& fp)
/**
* open_remote_dir -- open up a remote dirfrag
*
- * @diri - base inode
- * @approxfg - approximate fragment.
- * @fin - completion callback
+ * @param diri base inode
+ * @param approxfg approximate fragment.
+ * @param fin completion callback
*/
void MDCache::open_remote_dirfrag(CInode *diri, frag_t approxfg, Context *fin)
{
@@ -6947,8 +6947,8 @@ void MDCache::open_remote_dirfrag(CInode *diri, frag_t approxfg, Context *fin)
/**
* get_dentry_inode - get or open inode
*
- * @dn the dentry
- * @mdr current request
+ * @param dn the dentry
+ * @param mdr current request
*
* will return inode for primary, or link up/open up remote link's inode as necessary.
* If it's not available right now, puts mdr on wait list and returns null.
@@ -9343,9 +9343,9 @@ void MDCache::handle_dentry_unlink(MDentryUnlink *m)
/**
* adjust_dir_fragments -- adjust fragmentation for a directory
*
- * @diri - directory inode
- * @basefrag - base fragment
- * @bits - bit adjustment. positive for split, negative for merge.
+ * @param diri directory inode
+ * @param basefrag base fragment
+ * @param bits bit adjustment. positive for split, negative for merge.
*/
void MDCache::adjust_dir_fragments(CInode *diri, frag_t basefrag, int bits,
list<CDir*>& resultfrags,
diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h
index 0662cfa28e7..236f644458f 100644
--- a/src/mds/MDCache.h
+++ b/src/mds/MDCache.h
@@ -665,10 +665,10 @@ public:
* @param mdr The MDRequest associated with the path. Can be null.
* @param req The Message associated with the path. Can be null.
* @param fin The Context associated with the path. Can be null.
- * @param filepath The path to traverse to.
- * @pdnvec Data return parameter -- on success, contains a vector of dentries.
- * On failure, is either empty or contains the full trace of traversable
- * dentries.
+ * @param path The path to traverse to.
+ * @param pdnvec Data return parameter -- on success, contains a
+ * vector of dentries. On failure, is either empty or contains the
+ * full trace of traversable dentries.
* @param pin Data return parameter -- if successful, points to the inode
* associated with filepath. If unsuccessful, is null.
* @param onfail Specifies different lookup failure behaviors. If set to
diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc
index f5efa28a46d..a8c38a90e47 100644
--- a/src/mds/MDS.cc
+++ b/src/mds/MDS.cc
@@ -132,7 +132,6 @@ MDS::MDS(const std::string &n, Messenger *m, MonClient *mc) :
// beacon
beacon_last_seq = 0;
beacon_sender = 0;
- beacon_killer = 0;
was_laggy = false;
// tick
@@ -624,6 +623,12 @@ bool MDS::is_laggy()
dout(5) << "is_laggy " << since << " > " << g_conf->mds_beacon_grace
<< " since last acked beacon" << dendl;
was_laggy = true;
+ if (since > (g_conf->mds_beacon_grace*2)) {
+ // maybe it's not us?
+ dout(5) << "initiating monitor reconnect; maybe we're not the slow one"
+ << dendl;
+ monc->reopen_session();
+ }
return true;
}
return false;
@@ -656,8 +661,6 @@ void MDS::handle_mds_beacon(MMDSBeacon *m)
while (!beacon_seq_stamp.empty() &&
beacon_seq_stamp.begin()->first <= seq)
beacon_seq_stamp.erase(beacon_seq_stamp.begin());
-
- reset_beacon_killer();
} else {
dout(10) << "handle_mds_beacon " << ceph_mds_state_name(m->get_state())
<< " seq " << m->get_seq() << " dne" << dendl;
@@ -666,35 +669,6 @@ void MDS::handle_mds_beacon(MMDSBeacon *m)
m->put();
}
-void MDS::reset_beacon_killer()
-{
- utime_t when = beacon_last_acked_stamp;
- when += g_conf->mds_beacon_grace;
-
- dout(25) << "reset_beacon_killer last_acked_stamp at " << beacon_last_acked_stamp
- << ", will die at " << when << dendl;
-
- if (beacon_killer) timer.cancel_event(beacon_killer);
-
- beacon_killer = new C_MDS_BeaconKiller(this, beacon_last_acked_stamp);
- timer.add_event_at(when, beacon_killer);
-}
-
-void MDS::beacon_kill(utime_t lab)
-{
- if (lab == beacon_last_acked_stamp) {
- dout(0) << "beacon_kill last_acked_stamp " << lab
- << ", we are laggy!"
- << dendl;
- //suicide();
- } else {
- dout(20) << "beacon_kill last_acked_stamp " << beacon_last_acked_stamp
- << " != my " << lab
- << ", doing nothing."
- << dendl;
- }
-}
-
/* This function DOES put the passed message before returning*/
void MDS::handle_command(MMonCommand *m)
{
@@ -1551,10 +1525,6 @@ void MDS::suicide()
<< ", now " << ceph_mds_state_name(state) << dendl;
// stop timers
- if (beacon_killer) {
- timer.cancel_event(beacon_killer);
- beacon_killer = 0;
- }
if (beacon_sender) {
timer.cancel_event(beacon_sender);
beacon_sender = 0;
diff --git a/src/mds/MDS.h b/src/mds/MDS.h
index 4ea26dec20d..f74e2495803 100644
--- a/src/mds/MDS.h
+++ b/src/mds/MDS.h
@@ -279,19 +279,6 @@ class MDS : public Dispatcher {
mds->beacon_send();
}
} *beacon_sender;
- class C_MDS_BeaconKiller : public Context {
- MDS *mds;
- utime_t lab;
- public:
- C_MDS_BeaconKiller(MDS *m, utime_t l) : mds(m), lab(l) {}
- void finish(int r) {
- if (mds->beacon_killer) {
- mds->beacon_killer = 0;
- mds->beacon_kill(lab);
- }
- // else mds is pbly already shutting down
- }
- } *beacon_killer;
// tick and other timer fun
class C_MDS_Tick : public Context {
@@ -390,9 +377,7 @@ class MDS : public Dispatcher {
void beacon_start();
void beacon_send();
- void beacon_kill(utime_t lab);
void handle_mds_beacon(MMDSBeacon *m);
- void reset_beacon_killer();
// messages
bool _dispatch(Message *m);
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index d44bd7ea377..55e5a579efe 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -2041,10 +2041,10 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequest *mdr, int n,
/**
* try_open_auth_dirfrag -- open dirfrag, or forward to dirfrag auth
*
- * @diri base indoe
- * @fg the exact frag we want
- * @mdr request
- * Returns: the pointer, or NULL if it had to be delayed (but mdr is taken care of)
+ * @param diri base inode
+ * @param fg the exact frag we want
+ * @param mdr request
+ * @returns the pointer, or NULL if it had to be delayed (but mdr is taken care of)
*/
CDir* Server::try_open_auth_dirfrag(CInode *diri, frag_t fg, MDRequest *mdr)
{