]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debug_mds_log_expire, balancer tweak, MLock cleanup
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 10 Oct 2007 18:32:52 +0000 (18:32 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 10 Oct 2007 18:32:52 +0000 (18:32 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1913 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/config.cc
branches/sage/mds/config.h
branches/sage/mds/mds/MDBalancer.cc
branches/sage/mds/mds/journal.cc
branches/sage/mds/messages/MLock.h

index 5cd3b8e3cf2c5515c743234cf1aa1b55db1b82d7..16ba756825a6414f5c91536a6cc202b06d4b0f5b 100644 (file)
@@ -95,6 +95,7 @@ md_config_t g_conf = {
   debug_mds: 1,
   debug_mds_balancer: 1,
   debug_mds_log: 1,
+  debug_mds_log_expire: 1,
   debug_mds_migrator: 1,
   debug_buffer: 0,
   debug_timer: 0,
@@ -566,6 +567,11 @@ void parse_config_options(std::vector<char*>& args)
         g_conf.debug_mds_log = atoi(args[++i]);
       else 
         g_debug_after_conf.debug_mds_log = atoi(args[++i]);
+    else if (strcmp(args[i], "--debug_mds_log_expire") == 0) 
+      if (!g_conf.debug_after) 
+        g_conf.debug_mds_log_expire = atoi(args[++i]);
+      else 
+        g_debug_after_conf.debug_mds_log_expire = atoi(args[++i]);
     else if (strcmp(args[i], "--debug_mds_migrator") == 0) 
       if (!g_conf.debug_after) 
         g_conf.debug_mds_migrator = atoi(args[++i]);
index 2bc944f7382007f7c00436ee06de15803c739d3e..3c56f6af2094187efc9a0e3313c7480bb07d1073 100644 (file)
@@ -75,6 +75,7 @@ struct md_config_t {
   int debug_mds;
   int debug_mds_balancer;
   int debug_mds_log;
+  int debug_mds_log_expire;
   int debug_mds_migrator;
   int debug_buffer;
   int debug_timer;
index 88e524fe11322077af5401333d8bf1799f9121cb..8e9d0e2dd46fa93dfe3e87ca7534408baf3e6b00 100644 (file)
@@ -175,7 +175,7 @@ void MDBalancer::send_heartbeat()
   if (mds->get_nodeid() == 0)
     beat_epoch++;
 
-  // load
+  // my load
   mds_load_t load = get_load();
   mds_load[ mds->get_nodeid() ] = load;
 
@@ -243,7 +243,7 @@ void MDBalancer::handle_heartbeat(MHeartbeat *m)
 
   //dout(0) << "  load is " << load << " have " << mds_load.size() << dendl;
   
-  unsigned cluster_size = mds->get_mds_map()->get_num_mds();
+  unsigned cluster_size = mds->get_mds_map()->get_num_in_mds();
   if (mds_load.size() == cluster_size) {
     // let's go!
     //export_empties();  // no!
index 1837f5ab9ff82f43fd3be508c8432132c1e74366..eacf7f290057918af76db31fc8fe6f0b0cbf07d8 100644 (file)
@@ -46,8 +46,8 @@
 
 #include "config.h"
 
-#define  dout(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
-#define  derr(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
+#define  dout(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log || l <= g_conf.debug_mds_log_expire) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
+#define  derr(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log || l <= g_conf.debug_mds_log_expire) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
 
 
 // -----------------------
@@ -87,10 +87,10 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
         ++p) {
       CDir *dir = *p;
       if (dir->can_auth_pin()) {
-       dout(10) << "try_to_expire committing " << *dir << dendl;
+       dout(15) << "try_to_expire committing " << *dir << dendl;
        dir->commit(0, gather->new_sub());
       } else {
-       dout(10) << "try_to_expire waiting for unfreeze on " << *dir << dendl;
+       dout(15) << "try_to_expire waiting for unfreeze on " << *dir << dendl;
        dir->add_waiter(CDir::WAIT_UNFREEZE, gather->new_sub());
       }
     }
@@ -129,7 +129,10 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
 
   // clientmap
   if (clientmapv > mds->clientmap.get_committed()) {
-    dout(10) << "try_to_expire saving clientmap, need " << clientmapv << dendl;
+    dout(10) << "try_to_expire saving clientmap, need " << clientmapv 
+             << ", committed is " << mds->clientmap.get_committed()
+             << " (" << mds->clientmap.get_committing() << ")"
+             << dendl;
     if (!gather) gather = new C_Gather;
     mds->clientmap.save(gather->new_sub(), clientmapv);
   }
@@ -164,6 +167,13 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
 }
 
 
+
+#undef dout
+#undef derr
+#define  dout(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
+#define  derr(l)    if (l<=g_conf.debug_mds || l <= g_conf.debug_mds_log) *_dout << dbeginl << g_clock.now() << " mds" << mds->get_nodeid() << ".journal "
+
+
 // -----------------------
 // EString
 
index 208b5b6e8a00344f4f57548b3a3af7aeca565ed7..4fd027f4bf90220c4afd5df5ad89917d24412785 100644 (file)
@@ -53,8 +53,8 @@ static const char *get_lock_action_name(int a) {
 
 
 class MLock : public Message {
-  int       asker;  // who is initiating this request
-  int       action;  // action type
+  int32_t     action;  // action type
+  int32_t     asker;  // who is initiating this request
   metareqid_t reqid;  // for remote lock requests
 
   char      lock_type;  // lock object type
@@ -72,24 +72,20 @@ class MLock : public Message {
   MDSCacheObjectInfo &get_object_info() { return object_info; }
 
   MLock() {}
-  MLock(int action, int asker) :
-    Message(MSG_MDS_LOCK) {
-    this->action = action;
-    this->asker = asker;
-  }
-  MLock(SimpleLock *lock, int action, int asker) :
-    Message(MSG_MDS_LOCK) {
-    this->lock_type = lock->get_type();
+  MLock(int ac, int as) :
+    Message(MSG_MDS_LOCK),
+    action(ac), asker(as),
+    lock_type(0) { }
+  MLock(SimpleLock *lock, int ac, int as) :
+    Message(MSG_MDS_LOCK),
+    action(ac), asker(as),
+    lock_type(lock->get_type()) {
     lock->get_parent()->set_object_info(object_info);
-    this->action = action;
-    this->asker = asker;
   }
-  MLock(SimpleLock *lock, int action, int asker, bufferlist& bl) :
-    Message(MSG_MDS_LOCK) {
-    this->lock_type = lock->get_type();
+  MLock(SimpleLock *lock, int ac, int as, bufferlist& bl) :
+    Message(MSG_MDS_LOCK),
+    action(ac), asker(as), lock_type(lock->get_type()) {
     lock->get_parent()->set_object_info(object_info);
-    this->action = action;
-    this->asker = asker;
     data.claim(bl);
   }
   virtual char *get_type_name() { return "ILock"; }