]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
added some renewal stuff
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 31 Mar 2007 05:39:20 +0000 (05:39 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 31 Mar 2007 05:39:20 +0000 (05:39 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1329 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/client/ClientCapCache.h
branches/aleung/security1/ceph/mds/MDS.cc
branches/aleung/security1/ceph/mds/MDS.h
branches/aleung/security1/ceph/osd/OSD.cc

index 3d59f36c41f3ce37b42867e128d5a41efacd6414..a55410b0dbbea5c4ae6327d21bd020585ffbe057 100644 (file)
@@ -64,7 +64,7 @@ class ClientCapCache {
                                                         renewer_thread(this)
   {
     if (g_conf.renewal) {
-      cleaner_thread.create();
+      //cleaner_thread.create();
       renewer_thread.create();
     }
   }
@@ -73,8 +73,8 @@ class ClientCapCache {
     renewer_stop = true;
 
     if (g_conf.renewal) {
-      cleaner_cond.Signal();
-      cleaner_thread.join();
+      //cleaner_cond.Signal();
+      //cleaner_thread.join();
       renewer_cond.Signal();
       renewer_thread.join();
     }
@@ -149,14 +149,16 @@ class ClientCapCache {
 
     while (!renewer_stop) {
 
-      cout << "Renewer running" << endl;
+      cout << "Renewer running, requesting ";
       // renewal all open caps
       MClientRenewal *renewal = new MClientRenewal();
       for (map<uid_t, set<cap_id_t> >::iterator mi = caps_in_use.begin();
           mi != caps_in_use.end();
           mi++) {
        renewal->add_cap_set(mi->second);
+       cout << mi->second << ", ";
       }
+      cout << endl;
       
       // make asynchronous renewal request
       // FIXME always send to mds 0
index ca5f360e94693ed2f03f12fb46923f7c69779b66..1eba4c5243f7b7d49664bc00dc63760a589dd964 100644 (file)
@@ -98,6 +98,9 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) {
   myPrivKey = esignPrivKey("crypto/esig1023.dat");
   myPubKey = esignPubKey(myPrivKey);
 
+  cap_cache_hits = 0;
+  cap_requests = 0;
+
   // hard code the unix groups?
   if (g_conf.preload_unix_groups) {
     gid_t group_gid = 1020;
@@ -114,7 +117,7 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) {
     //cout << endl << "hash " << cgroup.get_root_hash() << endl;
   }
 
-
+  /*
   // create unix_groups from file?
   if (g_conf.unix_group_file) {
     ifstream from(g_conf.unix_group_file);
@@ -167,6 +170,7 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) {
     }
     cout << "Done doing unix group crap" << endl;
   }
+  */
 
   // do prediction read-in
   if (g_conf.mds_group == 4) {
@@ -175,7 +179,8 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) {
     bufferlist bl;
     server->get_bl_ss(bl);
     ::_decode(sequence, bl, off);
-    rp_predicter = RecentPopularity(sequence);
+    // set prediction sequence and parameters
+    rp_predicter = RecentPopularity(2, 6, sequence);
 
     for (map<inodeno_t, deque<inodeno_t> >::iterator mi = sequence.begin();
         mi != sequence.end();
@@ -882,6 +887,9 @@ int MDS::shutdown_start()
   dout(1) << "shutdown_start" << endl;
   derr(0) << "mds shutdown start" << endl;
 
+  cout << "Cap cache hits " << cap_cache_hits << endl;
+  cout << "Cap requests " << cap_requests << endl;
+
   // tell everyone to stop.
   set<int> active;
   mdsmap->get_active_mds_set(active);
index 27c204678c1dd5dc37ff963b960f440066039c37..be31fa36023c2e7ecb1ef08f50fc3b76261dfe52 100644 (file)
@@ -160,6 +160,9 @@ class MDS : public Dispatcher {
 public:
   map<int,version_t> peer_mdsmap_epoch;
 
+  
+  int cap_cache_hits;
+  int cap_requests;
   // logical user group
   //map<gid_t, CapGroup> unix_groups;
   map<gid_t, hash_t> unix_groups_map;
index a9ce630d3ea0ac38aa1027adce60d3d174d3c262..8965c6dab188ce4d1d50c111041cba8828c7c7f2 100644 (file)
@@ -429,6 +429,7 @@ void OSD::update_group(entity_inst_t client, hash_t my_hash, MOSDOp *op) {
   // set up reply
   MOSDUpdate *update = new MOSDUpdate(my_hash);
   Cond cond;
+  //cout << "OSD Requesting list update" << endl;
   
   // if no one has already requested the ticket
   if (update_waiter_op.count(my_hash) == 0) {
@@ -468,11 +469,11 @@ void OSD::handle_osd_update_reply(MOSDUpdateReply *m) {
   if (g_conf.mds_group == 3) {
     user_groups[my_hash].set_inode_list(m->get_file_list());
 
-    cout << "Received a group update for " << my_hash << endl;
+    dout(3) << "Received a group update for " << my_hash << endl;
     for (list<inodeno_t>::iterator ii = m->get_file_list().begin();
         ii != m->get_file_list().end();
         ii++) {
-      cout << my_hash << " contains " << (*ii) << endl;
+      dout(3) << my_hash << " contains " << (*ii) << endl;
     }
   }
   else
@@ -490,6 +491,7 @@ inline bool OSD::verify_cap(ExtCap *cap) {
   // have i already verified this cap?
   if (!cap_cache->prev_verified(cap->get_id())) {
 
+    dout(10) << "OSD verifying new cap" << endl;
     // actually verify
     if (cap->verif_extcap(monmap->get_key())) {
       // cache the verification
@@ -498,6 +500,8 @@ inline bool OSD::verify_cap(ExtCap *cap) {
     else
       return false;
   }
+  else
+    dout(10) << "OSD already cached cap" << endl;
   return true;
 }