]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 10 May 2005 16:40:07 +0000 (16:40 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 10 May 2005 16:40:07 +0000 (16:40 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@219 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/TODO
ceph/common/Clock.h
ceph/config.cc
ceph/mds/MDBalancer.cc
ceph/mds/MDBalancer.h
ceph/mds/MDCache.cc
ceph/mds/MDCache.h
ceph/mds/MDS.cc
ceph/msg/MPIMessenger.cc

index 1d1597314fedd338515606f166a18537272818ef..1a4a5ec491ce02ef16ae9bb293d900d45b2dd6d2 100644 (file)
--- a/ceph/TODO
+++ b/ceph/TODO
@@ -1,10 +1,20 @@
 
 SAGE:
 
-- mpimessenger: allow self-addressed messages
-- change export_proxy_*'s to lists (faster)
+- mount, unmount, distribute osdcluster
 
-- make balancer export empty dirs
+//- mpimessenger: allow self-addressed messages
+//- change export_proxy_*'s to lists (faster)
+
+//- make balancer export empty dirs
+
+/- finish testing foreign renames
+
+- no-cache tests
+
+- basic client read, write.
+
+- symlink loops
 
 - fix MExportAck and others to use dir+dentry, not inode
   (otherwise this all breaks with hard links.. altho it probably needs reworking already!)
@@ -15,9 +25,7 @@ SAGE:
   - fix noperm crap
   - clean up xlock interaction
 
-- finish testing foreign renames
 
-- symlink loops
 
 - fix logging model for data safety
  - inodeupdate
index 7951abaa34d324ce1f9dd408e4e2b11b52a31e5b..cf5ee1b6c85e0d33a80466c6069f3c434a1ad565 100644 (file)
@@ -3,6 +3,7 @@
 #define __CLOCK_H
 
 #include <sys/time.h>
+#include <time.h>
 
 class Clock {
  protected:
@@ -11,8 +12,13 @@ class Clock {
  public:
   Clock();
   
-  double gettime();
   void settime(double tm);
+
+  double gettime();
+  time_t get_unixtime() {
+       return time(0);
+  }
+
 };
 
 extern Clock g_clock;
index edc13c8c5eca11abb938b4b193067cc9afe0522f..ec53712f93acfdde4ad30e277465ece41cca02bd 100644 (file)
@@ -49,7 +49,7 @@ md_config_t g_conf = {
   mds_log_before_reply: true,
 
   // --- fakeclient (mds regression testing) ---
-  num_fakeclient: 1000,
+  num_fakeclient: 100,
   fakeclient_requests: 100,
   fakeclient_deterministic: false,
 
index 1516788f1e69508f02f63b714be24a0639510d2b..16bcb7bde50fd55ba35142717974f25810847b53 100644 (file)
@@ -121,14 +121,31 @@ void MDBalancer::handle_heartbeat(MHeartbeat *m)
   //cout << "  load is " << load << " have " << mds_load.size() << endl;
   
   int cluster_size = mds->get_cluster()->get_num_mds();
-  if (mds_load.size() == cluster_size) 
+  if (mds_load.size() == cluster_size) {
+       // let's go!
+       export_empties();
        do_rebalance();
+  }
   
   // done
   delete m;
 }
 
 
+void MDBalancer::export_empties() 
+{
+  dout(5) << "export_empties checking for empty imports" << endl;
+
+  for (set<CDir*>::iterator it = mds->mdcache->imports.begin();
+          it != mds->mdcache->imports.end();
+          it++) {
+       CDir *dir = *it;
+       
+       if (!dir->inode->is_root() && dir->get_size() == 0) 
+         mds->mdcache->export_empty_import(dir);
+  }
+}
+
 void MDBalancer::do_rebalance()
 {
   int cluster_size = mds->get_cluster()->get_num_mds();
index 86a1b008aa6506e41fd99f501f4f8f430b1e64fa..917dd945cef9b3dbb9f8238bdaa5231dfd360850 100644 (file)
@@ -36,6 +36,7 @@ class MDBalancer {
   void send_heartbeat();
   void handle_heartbeat(MHeartbeat *m);
 
+  void export_empties();
   void do_rebalance();
   void find_exports(CDir *dir, 
                                        double amount, 
index ece434383378deb1d6a33fa15410c6f7f6648f4d..e60b8b2d25460e17853ab6913784f971de070adb 100644 (file)
@@ -5063,7 +5063,7 @@ void MDCache::export_dir_walk(MExportDir *req,
   // proxy
   dir->state_set(CDIR_STATE_PROXY);
   dir->get(CDIR_PIN_PROXY);
-  export_proxy_dirinos[basedir].insert(dir->ino());
+  export_proxy_dirinos[basedir].push_back(dir->ino());
 
   if (!dir->is_clean())
        dir->mark_clean();
@@ -5128,7 +5128,7 @@ void MDCache::export_dir_walk(MExportDir *req,
        }
        
        // add to proxy
-       export_proxy_inos[basedir].insert(in->ino());
+       export_proxy_inos[basedir].push_back(in->ino());
        in->state_set(CINODE_STATE_PROXY);
        in->get(CINODE_PIN_PROXY);
 
@@ -5178,7 +5178,7 @@ void MDCache::handle_export_dir_notify_ack(MExportDirNotifyAck *m)
 
        // unpin proxies
        // inodes
-       for (set<inodeno_t>::iterator it = export_proxy_inos[dir].begin();
+       for (list<inodeno_t>::iterator it = export_proxy_inos[dir].begin();
                 it != export_proxy_inos[dir].end();
                 it++) {
          CInode *in = get_inode(*it);
@@ -5188,7 +5188,7 @@ void MDCache::handle_export_dir_notify_ack(MExportDirNotifyAck *m)
        export_proxy_inos.erase(dir);
 
        // dirs
-       for (set<inodeno_t>::iterator it = export_proxy_dirinos[dir].begin();
+       for (list<inodeno_t>::iterator it = export_proxy_dirinos[dir].begin();
                 it != export_proxy_dirinos[dir].end();
                 it++) {
          CDir *dir = get_inode(*it)->dir;
index ef502d0bdf53857b8d5c7a48bf5ec4af3ac99c6d..97a53253e477648a6250f19bb74aacb5bc8ebaa9 100644 (file)
@@ -90,19 +90,11 @@ class MDCache {
   set<CDir*>             imports;                // includes root (on mds0)
   set<CDir*>             exports;
   map<CDir*,set<CDir*> > nested_exports;
-  //multimap<CDir*,CDir*>  nested_exports;   // nested exports of (imports|root)
   
-  // hashing madness
-  multimap<CDir*, int>   unhash_waiting;  // nodes i am waiting for UnhashDirAck's from
-  multimap<inodeno_t, inodeno_t>    import_hashed_replicate_waiting;  // nodes i am waiting to discover to complete my import of a hashed dir
-        // maps frozen_dir_ino's to waiting-for-discover ino's.
-  multimap<inodeno_t, inodeno_t>    import_hashed_frozen_waiting;    // dirs i froze (for the above)
-  // maps import_root_ino's to frozen dir ino's (with pending discovers)
-
   // export fun
   map<CDir*, set<int> >  export_notify_ack_waiting; // nodes i am waiting to get export_notify_ack's from
-  map<CDir*, set<inodeno_t> > export_proxy_inos;
-  map<CDir*, set<inodeno_t> > export_proxy_dirinos;
+  map<CDir*, list<inodeno_t> > export_proxy_inos;
+  map<CDir*, list<inodeno_t> > export_proxy_dirinos;
 
   set<inodeno_t>                    stray_export_warnings; // notifies i haven't seen
   map<inodeno_t, MExportDirNotify*> stray_export_notifies;
@@ -111,6 +103,15 @@ class MDCache {
   set<inodeno_t>                    stray_rename_warnings; // notifies i haven't seen
   map<inodeno_t, MRenameNotify*>    stray_rename_notifies;
 
+  // hashing madness
+  multimap<CDir*, int>   unhash_waiting;  // nodes i am waiting for UnhashDirAck's from
+  multimap<inodeno_t, inodeno_t>    import_hashed_replicate_waiting;  // nodes i am waiting to discover to complete my import of a hashed dir
+        // maps frozen_dir_ino's to waiting-for-discover ino's.
+  multimap<inodeno_t, inodeno_t>    import_hashed_frozen_waiting;    // dirs i froze (for the above)
+  // maps import_root_ino's to frozen dir ino's (with pending discovers)
+
+
+
  public:
   // active MDS requests
   map<Message*, active_request_t>   active_requests;
index 7c7f41c49e277604c0f2fcbfe8437d2b53d529b5..536b33cdac138d7c25c8089f8f186ed63c041856 100644 (file)
@@ -1004,9 +1004,7 @@ CInode *MDS::mknod(MClientRequest *req, CInode *diri, bool okexist)
   newi->inode.mode = req->get_iarg();
   newi->inode.uid = req->get_caller_uid();
   newi->inode.gid = req->get_caller_gid();
-  newi->inode.ctime = 1;  // now, FIXME
-  newi->inode.mtime = 1;  // now, FIXME
-  newi->inode.atime = 1;  // now, FIXME
+  newi->inode.ctime = newi->inode.mtime = newi->inode.atime = g_clock.get_unixtime();   // now
 
   // link
   if (!dn) 
@@ -1336,7 +1334,7 @@ void MDS::handle_client_rename(MClientRequest *req,
   // ok, done passing buck.
 
   // src dentry
-  CDentry *srcdn = srcdir->lookup(srcname);     // FIXME for hard links
+  CDentry *srcdn = srcdir->lookup(srcname);
 
   // xlocked?
   if (srcdn && !srcdn->can_read(req)) {
@@ -1655,15 +1653,16 @@ void MDS::handle_client_rename_local(MClientRequest *req,
 
   // FIXME: is this necessary?
 
-  /*
   if (destdn->inode) {
        if (destdn->inode->is_dir()) {
          dout(7) << "handle_client_rename_local failing, dest exists and is a dir: " << *destdn->inode << endl;
+         assert(0);
          reply_request(req, -EINVAL);  
          return; 
        }
        if (srcdn->inode->is_dir()) {
          dout(7) << "handle_client_rename_local failing, dest exists and src is a dir: " << *destdn->inode << endl;
+         assert(0);
          reply_request(req, -EINVAL);  
          return; 
        }
@@ -1673,10 +1672,14 @@ void MDS::handle_client_rename_local(MClientRequest *req,
        // REQXLOCKC, which will only allow you to lock a file.
        // so we know dest is a file, or non-existent
        if (!destlocal) {
-         
+         if (srcdn->inode->is_dir()) { 
+               // help: maybe the dest exists and is a file?   ..... FIXME
+         } else {
+               // we're fine, src is file, dest is file|dne
+         }
        }
   }
-  */
+  
 
 
   // we're golden.
index a4ea542cb4ad9011c6055c6bbdc0684c251aa885..a9a7c5d48e8cdbb05989a7bd230af6e9f1f5a2b6 100644 (file)
@@ -141,12 +141,14 @@ int mpi_send(Message *m, int rank, int tag)
   dout(10) << "mpi_sending " << size << " byte message to rank " << rank << " tag " << tag << endl;
 
   // sending
-  ASSERT(MPI_Send((void*)buf,
-                                 size,
-                                 MPI_CHAR,
-                                 rank,
-                                 tag,
-                                 MPI_COMM_WORLD) == MPI_SUCCESS);
+  MPI_Request req;             // non-blocking, in case we send to ourselves from same thread
+  ASSERT(MPI_Isend((void*)buf,
+                                  size,
+                                  MPI_CHAR,
+                                  rank,
+                                  tag,
+                                  MPI_COMM_WORLD,
+                                  &req) == MPI_SUCCESS);
 }