]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 8 Jul 2005 06:00:55 +0000 (06:00 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 8 Jul 2005 06:00:55 +0000 (06:00 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@422 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/TODO
ceph/client/Client.cc
ceph/client/Client.h
ceph/config.cc
ceph/mds/CInode.h
ceph/messages/MClientReply.h
ceph/osd/OSD.cc

index d987f397c93636cf7920553a34979e86b489dc41..ca5beb9e3d0957d20675d178aa53df1d536c9318 100644 (file)
--- a/ceph/TODO
+++ b/ceph/TODO
@@ -4,7 +4,8 @@ fakesyn: mds/MDS.cc:2334: void MDS::handle_client_close(MClientRequest*, CInode*
 - caps needs to be rewritten
  - MDS currently not reclaiming fh's  (otherwise a client assertion eventually fails)
 - hard links!
-
+- g_clock.gettimepair() all over the place.. need a get_recent()!
+- the client request direction is sort of borken.. some reqs have to go to auth, others don't
 
 
 !!!
index 607a4edc79dc63f035779856a1a6d4918b4cda79..d72c52fc2d1a972ce0ce49437c8deca7a45b8ce6 100644 (file)
@@ -224,6 +224,7 @@ Inode* Client::insert_inode_info(Dir *dir, c_inode_info *in_info)
   dn->inode->mds_contacts = in_info->dist;
   dn->inode->mds_dir_auth = in_info->dir_auth;
 
+
   return dn->inode;
 }
 
@@ -302,7 +303,6 @@ Dentry *Client::lookup(filepath& path)
 MClientReply *Client::make_request(MClientRequest *req, bool auth_best)
 {
   // send to what MDS?  find deepest known prefix
-  int mds = 0;
   Inode *cur = root;
   for (int i=0; i<req->get_filepath().depth(); i++) {
        if (cur && cur->inode.mode & INODE_MODE_DIR && cur->dir) {
@@ -311,30 +311,30 @@ MClientReply *Client::make_request(MClientRequest *req, bool auth_best)
          if (dir->dentries.count( req->get_filepath()[i] ) == 0) 
                break;
          
-         dout(7) << " have path seg " << i << " " << cur->inode.ino << " " << req->get_filepath()[i] << endl;
+         dout(7) << " have path seg " << i << " on " << cur->mds_dir_auth << " ino " << cur->inode.ino << " " << req->get_filepath()[i] << endl;
          cur = dir->dentries[ req->get_filepath()[i] ]->inode;
          assert(cur);
        } else
          break;
   }
   
+  int mds = 0;
   if (cur) {
-       if (auth_best) {  // hack fixme 
-         mds = cur->authority();
-       } else {
-         if (cur->mds_contacts.size()) {
-               dout(9) << "contacting mds from deepest inode " << cur->inode.ino << " " << req->get_filepath() << ": " << cur->mds_contacts << endl;
-               set<int>::iterator it = cur->mds_contacts.begin();
-               if (cur->mds_contacts.size() == 1)
-                 mds = *it;
-               else {
-                 int r = rand() % cur->mds_contacts.size();
-                 while (r--) it++;
-                 mds = *it;
-               }
-         } else {
-               mds = cur->authority();
+       if (!auth_best && cur->mds_contacts.size()) {
+         // try replica(s)
+         dout(9) << "contacting mds from deepest inode " << cur->inode.ino << " " << req->get_filepath() << ": " << cur->mds_contacts << endl;
+         set<int>::iterator it = cur->mds_contacts.begin();
+         if (cur->mds_contacts.size() == 1)
+               mds = *it;
+         else {
+               int r = rand() % cur->mds_contacts.size();
+               while (r--) it++;
+               mds = *it;
          }
+       } else {
+         // try auth
+         mds = cur->authority();
+         dout(9) << "contacting auth mds " << mds << endl;
        }
   } else {
        dout(9) << "i have no idea where " << req->get_filepath() << " is" << endl;
index 5a62c732a208f793a94cb27b0e7da79175beb2e9..7502e6767195a281240a07f189a065882c76a834 100644 (file)
@@ -100,10 +100,14 @@ class Inode {
   }
 
   int authority() {
-       if (mds_dir_auth >= 0) 
+       // my info valid?
+       if (mds_dir_auth >= 0)  
          return mds_dir_auth;
-       if (dn && dn->dir && dn->dir->parent_inode)
+       
+       // otherwise try parent
+       if (dn && dn->dir && dn->dir->parent_inode) 
          return dn->dir->parent_inode->authority();
+
        return 0;  // who knows!
   }
 
index d2ee1d1a4025d6305e680a3647ffe951fc409f3d..41cd853d2e1cefac47bbb0b87d205034c19f676e 100644 (file)
@@ -77,8 +77,8 @@ md_config_t g_conf = {
   mds_log_before_reply: true,
   mds_log_flush_on_shutdown: true,
 
-  mds_bal_replicate_threshold: 50000,
-  mds_bal_unreplicate_threshold: 20000,
+  mds_bal_replicate_threshold: 500,
+  mds_bal_unreplicate_threshold: 200,
   mds_bal_interval: 30,           // seconds
   mds_bal_idle_threshold: .1,
   mds_bal_max: -1,
index 4030b95cda9a78e8745608ab9648bb08ebbffce4..a85579b98dec3bf18f825cab1485ae97b50bc58e 100644 (file)
@@ -523,7 +523,6 @@ class CInode : LRUObject {
        if (popularity[MDS_POP_JUSTME].get(now) > g_conf.mds_bal_replicate_threshold) {
          ls = cached_by;
        }
-       ls.insert(auth);
   }
 
 
index c30bb323e0120c926c94a174e3c33e4337bf88ac..a4241b793bbf6f22a949779a91eeffeaaeff954c 100644 (file)
@@ -61,10 +61,10 @@ class c_inode_info {
        this->ref_dn = ref_dn;
        
        // replicated where?
-       if (in->dir) 
+       if (in->is_dir() && in->dir) 
          dir_auth = in->dir->get_dir_auth();
        else 
-         dir_auth -1;
+         dir_auth -1;
        in->get_dist_spec(this->dist, whoami, now);
   }
   
index bdfdb1b68538fcc8782986c8c243dfb50bd78c5f..f33c5be1f1534034a375ba40a880e87dc8bc00ea 100644 (file)
@@ -171,6 +171,7 @@ void OSD::dispatch(Message *m)
 
   default:
        dout(1) << " got unknown message " << m->get_type() << endl;
+       assert(0);
   }
 }