]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 10 Jun 2005 18:43:02 +0000 (18:43 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 10 Jun 2005 18:43:02 +0000 (18:43 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@292 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/config.cc
ceph/config.h
ceph/mds/MDCache.cc
ceph/mds/MDS.cc

index 78e75bab1ac21ff07af092e75df025fe46544fd8..af51bc015ab5eef16e0498bf1515b5a34e68b03f 100644 (file)
@@ -39,12 +39,13 @@ md_config_t g_conf = {
   mds_log_max_trimming: 16,
   mds_log_read_inc: 65536,
   mds_log_before_reply: true,
-  mds_log_flush_on_shutdown: true,
+  mds_log_flush_on_shutdown: false,  //true,
 
   mds_bal_replicate_threshold: 500,
   mds_bal_unreplicate_threshold: 200,
   mds_bal_interval: 200,
 
+  mds_flush_on_shutdown: true,
   mds_verify_export_dirauth: true,
 
 
@@ -108,18 +109,26 @@ void parse_config_options(int argc, char **argv,
          g_conf.num_client = atoi(argv[++i]);
        else if (strcmp(argv[i], "--numosd") == 0) 
          g_conf.num_osd = atoi(argv[++i]);
+
        else if (strcmp(argv[i], "--debug") == 0) 
          g_conf.debug = atoi(argv[++i]);
+
        else if (strcmp(argv[i], "--mds_cache_size") == 0) 
          g_conf.mds_cache_size = atoi(argv[++i]);
        else if (strcmp(argv[i], "--mds_log_max_len") == 0) 
          g_conf.mds_log_max_len = atoi(argv[++i]);
        else if (strcmp(argv[i], "--mds_log_max_trimming") == 0) 
          g_conf.mds_log_max_trimming = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_flush_on_shutdown") == 0) 
+         g_conf.mds_flush_on_shutdown = atoi(argv[++i]);
        else if (strcmp(argv[i], "--mds_log_flush_on_shutdown") == 0) 
          g_conf.mds_log_flush_on_shutdown = atoi(argv[++i]);
        else if (strcmp(argv[i], "--mds_bal_interval") == 0) 
          g_conf.mds_bal_interval = atoi(argv[++i]);
+
+       else if (strcmp(argv[i], "--osd_fsync") == 0) 
+         g_conf.osd_fsync = atoi(argv[++i]);
+
        else {
          //cout << "passing arg " << argv[i] << endl;
          nargv[nargc++] = argv[i];
index aefc78b704b0d4c7f6f9651b9ec2aa2f1e4bffd0..77dbd8196c6e8c2231a9b73e7798826a5346d215 100644 (file)
@@ -37,6 +37,7 @@ struct md_config_t {
   float mds_bal_unreplicate_threshold;
   int   mds_bal_interval;
 
+  bool  mds_flush_on_shutdown;
   bool  mds_verify_export_dirauth;     // debug flag
 
   // osd
index 1f89fd3a639bf4284327eaf5379682ae15b9c336..b4b11b513799e56727d97f435b09e5540d8b7517 100644 (file)
@@ -523,23 +523,20 @@ bool MDCache::trim(__int32_t max) {
 
 void MDCache::shutdown_start()
 {
-  dout(1) << "shutdown_start: forcing unsync, unlock of everything" << endl;
+  dout(1) << "shutdown_start" << endl;
 
-  // walk cache
-  bool didsomething = false;
-  for (hash_map<inodeno_t, CInode*>::iterator it = inode_map.begin();
-          it != inode_map.end();
-          it++) {
-       CInode *in = it->second;
+  if (g_conf.mds_commit_on_shutdown) {
+       dout(1) << "shutdown_start committing all dirty dirs" << endl;
 
-       // commit any dirty dir that's ours
-       if (in->is_dir() && in->dir && in->dir->is_auth() && in->dir->is_dirty())
-         mds->mdstore->commit_dir(in->dir, NULL);
-       
-       //drop locks?
-       if (in->is_auth()) {
-         //if (in->is_syncbyme()) inode_sync_release(in);
-         //if (in->is_lockbyme()) inode_lock_release(in);
+       for (hash_map<inodeno_t, CInode*>::iterator it = inode_map.begin();
+                it != inode_map.end();
+                it++) {
+         CInode *in = it->second;
+         
+         // commit any dirty dir that's ours
+         if (in->is_dir() && in->dir && in->dir->is_auth() && in->dir->is_dirty())
+               mds->mdstore->commit_dir(in->dir, NULL);
+         
        }
   }
 
@@ -611,7 +608,8 @@ bool MDCache::shutdown_pass()
   assert(inode_map.size() == lru.lru_get_size());
 
   // done?
-  if ((lru.lru_get_size() == 0 || g_conf.mds_log_flush_on_shutdown == false) && 
+  if ((lru.lru_get_size() == 0 || 
+          (g_conf.mds_commit_on_shutdown == false && g_conf.mds_log_flush_on_shutdown == false)) && 
          !mds->filer->is_active()) {
        if (mds->get_nodeid() != 0) {
          dout(7) << "done, sending shutdown_finish" << endl;
index 4d36d4efec64d5cb453ebc1e00add7c56915dc86..c63abd45268cf788f4a5f641bcd9de11d8267b6a 100644 (file)
@@ -458,7 +458,7 @@ void MDS::handle_client_mount(MClientMount *m)
                return;
          } else {
                // fake out idalloc (reset, pretend loaded)
-               mds->idalloc->reset();
+               idalloc->reset();
          }
          
        }