From f039c234b243637adffaba0e175e95e355867129 Mon Sep 17 00:00:00 2001 From: anwleung Date: Sat, 31 Mar 2007 05:39:20 +0000 Subject: [PATCH] added some renewal stuff git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1329 29311d96-e01e-0410-9327-a35deaab8ce9 --- .../aleung/security1/ceph/client/ClientCapCache.h | 10 ++++++---- branches/aleung/security1/ceph/mds/MDS.cc | 12 ++++++++++-- branches/aleung/security1/ceph/mds/MDS.h | 3 +++ branches/aleung/security1/ceph/osd/OSD.cc | 8 ++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/branches/aleung/security1/ceph/client/ClientCapCache.h b/branches/aleung/security1/ceph/client/ClientCapCache.h index 3d59f36c41f3c..a55410b0dbbea 100644 --- a/branches/aleung/security1/ceph/client/ClientCapCache.h +++ b/branches/aleung/security1/ceph/client/ClientCapCache.h @@ -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 >::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 diff --git a/branches/aleung/security1/ceph/mds/MDS.cc b/branches/aleung/security1/ceph/mds/MDS.cc index ca5f360e94693..1eba4c5243f7b 100644 --- a/branches/aleung/security1/ceph/mds/MDS.cc +++ b/branches/aleung/security1/ceph/mds/MDS.cc @@ -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 >::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 active; mdsmap->get_active_mds_set(active); diff --git a/branches/aleung/security1/ceph/mds/MDS.h b/branches/aleung/security1/ceph/mds/MDS.h index 27c204678c1dd..be31fa36023c2 100644 --- a/branches/aleung/security1/ceph/mds/MDS.h +++ b/branches/aleung/security1/ceph/mds/MDS.h @@ -160,6 +160,9 @@ class MDS : public Dispatcher { public: map peer_mdsmap_epoch; + + int cap_cache_hits; + int cap_requests; // logical user group //map unix_groups; map unix_groups_map; diff --git a/branches/aleung/security1/ceph/osd/OSD.cc b/branches/aleung/security1/ceph/osd/OSD.cc index a9ce630d3ea0a..8965c6dab188c 100644 --- a/branches/aleung/security1/ceph/osd/OSD.cc +++ b/branches/aleung/security1/ceph/osd/OSD.cc @@ -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::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; } -- 2.39.5