]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 1 Mar 2006 19:51:41 +0000 (19:51 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 1 Mar 2006 19:51:41 +0000 (19:51 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@714 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/mds/CInode.cc
ceph/mds/MDBalancer.cc
ceph/mds/MDCache.cc
ceph/mds/MDS.cc

index e58764d62e378ffc88b4216fd4df1358e226581f..c4c3b2064204169061a05ae1a41fbe87f60bdcb4 100644 (file)
@@ -480,6 +480,8 @@ int CInode::authority() {
 
 CInodeDiscover* CInode::replicate_to( int rep )
 {
+  assert(is_auth());
+
   // relax locks?
   if (!is_cached_by_anyone())
        replicate_relax_locks();
index dcb294197685b4abed253245fa889ae8eb6043bf..ec8ce9fd46c5a71708fe790ecdb1fa13faeca8cd 100644 (file)
@@ -533,7 +533,7 @@ void MDBalancer::find_exports(CDir *dir,
 
   double dir_pop = dir->popularity[MDS_POP_CURDOM].meta_load();
   double dir_sum = 0;
-  dout(7) << " find_exports in " << dir_pop << " " << *dir << " need " << need << " (" << needmin << " - " << needmax << ")" << endl;
+  dout(-7) << " find_exports in " << dir_pop << " " << *dir << " need " << need << " (" << needmin << " - " << needmax << ")" << endl;
 
   for (CDir_map_t::iterator it = dir->begin();
           it != dir->end();
@@ -653,16 +653,20 @@ void MDBalancer::hit_dir(CDir *dir, int type)
 
   // hit modify counter, if this was a modify
   if (g_conf.num_mds > 2 &&             // FIXME >2 thing
-         dir->is_auth() && 
-         !dir->inode->is_root()) {         // not root (for now at least)
+         !dir->inode->is_root() &&        // not root (for now at least)
+         dir->is_auth()) {
+       //dout(-20) << "hit_dir " << type << " pop is " << v << "  " << *dir << endl;
+
        // hash this dir?  (later?)
        if (((v > g_conf.mds_bal_hash_rd && type == META_POP_IRD) ||
-                (v > g_conf.mds_bal_hash_wr && type == META_POP_IWR)) &&
+                //(v > g_conf.mds_bal_hash_wr && type == META_POP_IWR) ||
+                (v > g_conf.mds_bal_hash_wr && type == META_POP_DWR)) &&
                !(dir->is_hashed() || dir->is_hashing()) &&
                hash_queue.count(dir->ino()) == 0) {
          dout(0) << "hit_dir " << type << " pop is " << v << ", putting in hash_queue: " << *dir << endl;
          hash_queue.insert(dir->ino());
        }
+
   }
   
   hit_recursive(dir, type);
@@ -790,7 +794,7 @@ void MDBalancer::add_import(CDir *dir)
 void MDBalancer::show_imports(bool external)
 {
   int db = 20; //debug level
-
+  return;
   
   if (mds->mdcache->imports.empty() &&
          mds->mdcache->hashdirs.empty()) {
index 3c96234d874d2fd589c61126f3eaec0a30e10b8e..477aaad04daa42b6ed8817966a25916535c6bf67 100644 (file)
@@ -1332,7 +1332,9 @@ int MDCache::path_traverse(filepath& origpath,
                  if (((MClientRequest*)req)->get_mds_wants_replica_in_dirino() == cur->dir->ino() &&
                          cur->dir->is_auth() && 
                          cur->dir->is_rep() &&
-                         cur->dir->is_open_by(req->get_source().num())) {
+                         cur->dir->is_open_by(req->get_source().num()) &&
+                         dn->get_inode()->is_auth()
+                         ) {
                        assert(req->get_source().is_mds());
                        int from = req->get_source().num();
                        
index bbf51ac0ea9abce9746f3410f817240ede5c47df..ea65983c75ae41a99e5384c91575d52508264a96 100644 (file)
@@ -560,6 +560,17 @@ void MDS::my_dispatch(Message *m)
        finish_contexts(ls);
   }
 
+  // hash root?
+  if (false &&
+         mdcache->get_root() &&
+         mdcache->get_root()->dir &&
+         !(mdcache->get_root()->dir->is_hashed() || 
+               mdcache->get_root()->dir->is_hashing())) {
+       dout(0) << "hashing root" << endl;
+       mdcache->hash_dir(mdcache->get_root()->dir);
+  }
+
+
   // periodic crap (1-second resolution)
   static utime_t last_log = g_clock.recent_now();
   utime_t now = g_clock.recent_now();
@@ -2589,6 +2600,17 @@ void MDS::handle_client_mkdir(MClientRequest *req, CInode *diri)
   
   balancer->hit_dir(newdir, META_POP_DWR);
 
+  if (diri->dir->is_auth() &&
+         diri->dir->is_rep() &&
+         newdir->is_auth() &&
+         !newdir->is_hashing()) {
+       int dest = rand() % mdcluster->get_num_mds();
+       if (dest != whoami) {
+         dout(-10) << "exporting new dir " << *newdir << " in replicated parent " << *diri->dir << endl;
+         mdcache->export_dir(newdir, dest);
+       }
+  }
+
   // commit
   commit_request(req, new MClientReply(req, 0), diri,
                                 new EInodeUpdate(newi),