]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: start resolve with root as UNKNOWN (if it's not ours)
authorSage Weil <sage@newdream.net>
Tue, 4 Aug 2009 04:34:15 +0000 (21:34 -0700)
committerSage Weil <sage@newdream.net>
Tue, 4 Aug 2009 22:33:36 +0000 (15:33 -0700)
Anything that's not ours should be unknown, including the root dir frag,
which normally starts out as mds0.

If we leave it as 0, then when mds0 claims a subset of /, its bounds are
left as 0 as well instead of being set to unknown.  Which leads to
incorrect resolve stage results.

src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDS.cc

index b34764babae30a2a2d9d319ec261dba3cd39a4ad..f9a9adae83b76557ea62372c77f57db9be52f1a8 100644 (file)
@@ -1989,6 +1989,32 @@ ESubtreeMap *MDCache::create_subtree_map()
 }
 
 
+void MDCache::resolve_start()
+{
+  dout(10) << "resolve_start" << dendl;
+
+  if (mds->mdsmap->get_root() != mds->whoami) {
+    // if we don't have the root dir, adjust it to UNKNOWN.  during
+    // resolve we want mds0 to explicit claim the portion of it that
+    // it owns, so that anything beyond its bounds get left as
+    // unknown.
+    CDir *rootdir = root->get_dirfrag(frag_t());
+    adjust_subtree_auth(rootdir, CDIR_AUTH_UNKNOWN);
+  }
+
+  set<int> who;
+  mds->mdsmap->get_mds_set(who, MDSMap::STATE_RESOLVE);
+  mds->mdsmap->get_mds_set(who, MDSMap::STATE_REJOIN);
+  mds->mdsmap->get_mds_set(who, MDSMap::STATE_CLIENTREPLAY);
+  mds->mdsmap->get_mds_set(who, MDSMap::STATE_ACTIVE);
+  mds->mdsmap->get_mds_set(who, MDSMap::STATE_STOPPING);
+  for (set<int>::iterator p = who.begin(); p != who.end(); ++p) {
+    if (*p == mds->whoami)
+      continue;
+    send_resolve(*p);  // now.
+  }
+}
+
 void MDCache::send_resolve(int who)
 {
   if (migrator->is_importing() || 
index 42849cdddf818901fe4ca54ebd786e4c9806b101..744d4657ea8a8d3a138a0de9611da4f6ada742d0 100644 (file)
@@ -664,6 +664,7 @@ public:
   }
   void cancel_ambiguous_import(dirfrag_t dirino);
   void finish_ambiguous_import(dirfrag_t dirino);
+  void resolve_start();
   void send_resolve(int who);
   void send_resolve_now(int who);
   void send_resolve_later(int who);
index 6c10ed85e0ad703f3d59d8b7d603b76b9199f5ff..9c87808aef82c5d1a4c5553f5c5e2f93fc8624c3 100644 (file)
@@ -972,16 +972,7 @@ void MDS::replay_done()
 void MDS::resolve_start()
 {
   dout(1) << "resolve_start" << dendl;
-
-  set<int> who;
-  mdsmap->get_mds_set(who, MDSMap::STATE_RESOLVE);
-  mdsmap->get_mds_set(who, MDSMap::STATE_REJOIN);
-  mdsmap->get_mds_set(who, MDSMap::STATE_ACTIVE);
-  mdsmap->get_mds_set(who, MDSMap::STATE_STOPPING);
-  for (set<int>::iterator p = who.begin(); p != who.end(); ++p) {
-    if (*p == whoami) continue;
-    mdcache->send_resolve(*p);  // now.
-  }
+  mdcache->resolve_start();
 }
 void MDS::resolve_done()
 {