]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 5 Jul 2005 17:28:24 +0000 (17:28 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 5 Jul 2005 17:28:24 +0000 (17:28 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@398 29311d96-e01e-0410-9327-a35deaab8ce9

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

index 81bce9027b56a63c8fdbc19c916c68d732184e0b..4ab5ffa1c76fad8d4f492dadf7ded401db25926b 100644 (file)
@@ -76,6 +76,7 @@ md_config_t g_conf = {
   mds_bal_interval: 30,           // seconds
   mds_bal_idle_threshold: .1,
   mds_bal_max: -1,
+  mds_bal_max_until: -1,
 
   mds_commit_on_shutdown: true,
 
@@ -188,6 +189,8 @@ void parse_config_options(int argc, char **argv,
          g_conf.mds_bal_interval = atoi(argv[++i]);
        else if (strcmp(argv[i], "--mds_bal_max") == 0) 
          g_conf.mds_bal_max = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--mds_bal_max_until") == 0) 
+         g_conf.mds_bal_max_until = atoi(argv[++i]);
 
        else if (strcmp(argv[i], "--client_cache_size") == 0)
          g_conf.client_cache_size = atoi(argv[++i]);
index 6a4a84ff8cedfeca5456b0c7e4ea738ec4ab32ad..b3bf82b746a31b03622a19a9df48a6a5b2e28453 100644 (file)
@@ -51,6 +51,7 @@ struct md_config_t {
   int   mds_bal_interval;
   float mds_bal_idle_threshold;
   int   mds_bal_max;
+  int   mds_bal_max_until;
 
   bool  mds_commit_on_shutdown;
   bool  mds_verify_export_dirauth;     // debug flag
index 6420e1ad639c942c95d11ce435944fa219be0f98..f3440a9de8ee2a61cd2adc8200140762a80eaba5 100644 (file)
@@ -444,8 +444,12 @@ void MDS::my_dispatch(Message *m)
 
   // balance?
   static int num_bal_times = g_conf.mds_bal_max;
+  static timepair_t first = g_clock.gettimepair();
   timepair_t now = g_clock.gettimepair();
-  if (true && num_bal_times && whoami == 0 &&
+  timepair_t elapsed = now - first;
+  if (true && 
+         whoami == 0 &&
+         (num_bal_times || (g_conf.mds_bal_max_until >= 0 && elapsed.first > g_conf.mds_bal_max_until)) && 
          !shutting_down && !shut_down &&
          now.first - last_balancer_heartbeat.first >= g_conf.mds_bal_interval) {
        last_balancer_heartbeat = now;
index a05a787354527ab06f7278b642e6196d478f9ae9..0415cefe92655c73c59ba4a17218b6c0d337c17a 100644 (file)
@@ -442,21 +442,21 @@ void MDStore::do_commit_dir_2( int result,
 
        // dentry
        if (committed_version > dn->get_parent_dir_version()) {
-         dout(5) << " dir " << committed_version << " > dn " << dn->get_parent_dir_version() << " still clean " << *dn << endl;
+         dout(15) << " dir " << committed_version << " > dn " << dn->get_parent_dir_version() << " still clean " << *dn << endl;
          assert(!dn->is_dirty());
        }
        else if (dn->get_parent_dir_version() == committed_version) {
-         dout(5) << " dir " << committed_version << " == dn " << dn->get_parent_dir_version() << " now clean " << *dn << endl;
+         dout(15) << " dir " << committed_version << " == dn " << dn->get_parent_dir_version() << " now clean " << *dn << endl;
          dn->mark_clean();     // might not but could be dirty
          
          // remove, if it's null and unlocked
          if (dn->is_null() && dn->is_sync()) {
-               dout(5) << "   removing clean and null " << *dn << endl;
+               dout(15) << "   removing clean and null " << *dn << endl;
                null_clean.push_back(dn);
                continue;
          }
        } else {
-         dout(5) << " dir " << committed_version << " < dn " << dn->get_parent_dir_version() << " still dirty " << *dn << endl;
+         dout(15) << " dir " << committed_version << " < dn " << dn->get_parent_dir_version() << " still dirty " << *dn << endl;
          assert(committed_version < dn->get_parent_dir_version());
          assert(dn->is_dirty() || !dn->is_sync());
        }
@@ -469,14 +469,14 @@ void MDStore::do_commit_dir_2( int result,
        assert(in->is_auth());
        
        if (committed_version > in->get_parent_dir_version()) {
-         dout(5) << " dir " << committed_version << " > inode " << in->get_parent_dir_version() << " still clean " << *(in) << endl;
+         dout(15) << " dir " << committed_version << " > inode " << in->get_parent_dir_version() << " still clean " << *(in) << endl;
          assert(!in->is_dirty());
        }
        else if (in->get_parent_dir_version() == committed_version) {
-         dout(5) << " dir " << committed_version << " == inode " << in->get_parent_dir_version() << " now clean " << *(in) << endl;
+         dout(15) << " dir " << committed_version << " == inode " << in->get_parent_dir_version() << " now clean " << *(in) << endl;
          in->mark_clean();     // might not but could be dirty
        } else {
-         dout(5) << " dir " << committed_version << " < inode " << in->get_parent_dir_version() << " still dirty " << *(in) << endl;
+         dout(15) << " dir " << committed_version << " < inode " << in->get_parent_dir_version() << " still dirty " << *(in) << endl;
          assert(committed_version < in->get_parent_dir_version());
          assert(in->is_dirty());
        }