]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
removed old has_expired/expired log event cruft
authorSage Weil <sage@newdream.net>
Mon, 31 Dec 2007 23:37:29 +0000 (15:37 -0800)
committerSage Weil <sage@newdream.net>
Mon, 31 Dec 2007 23:37:29 +0000 (15:37 -0800)
13 files changed:
src/mds/Server.cc
src/mds/SessionMap.h
src/mds/events/EExport.h
src/mds/events/EFragment.h
src/mds/events/EImportFinish.h
src/mds/events/EImportStart.h
src/mds/events/EMetaBlob.h
src/mds/events/EPurgeFinish.h
src/mds/events/ESession.h
src/mds/events/ESlaveUpdate.h
src/mds/events/EString.h
src/mds/events/ESubtreeMap.h
src/mds/journal.cc

index 2e5ae550cc2079871d33bd374b2ffcbcf493e2bc..29e9e37b61693871feff392d41b17c76cdd3cacf 100644 (file)
@@ -218,9 +218,6 @@ void Server::_session_logged(Session *session, bool open, version_t pv)
 
 void Server::prepare_force_open_sessions(map<int,entity_inst_t>& cm)
 {
-  /* 
-   * FIXME !
-   */
   version_t pv = ++mds->sessionmap.projected;
   dout(10) << "prepare_force_open_sessions " << pv 
           << " on " << cm.size() << " clients"
@@ -245,17 +242,6 @@ void Server::finish_force_open_sessions(map<int,entity_inst_t>& cm)
   for (map<int,entity_inst_t>::iterator p = cm.begin(); p != cm.end(); ++p) {
     Session *session = mds->sessionmap.get_session(p->second.name);
     assert(session);
-    /*
-    if (session->is_closing()) {
-      dout(15) << "force_open_sessions canceling close on " << session->inst << dendl;
-      mds->clientmap.remove_closing(p->first);
-      continue;
-    }
-    if (mds->clientmap.have_session(p->first)) {
-      dout(15) << "force_open_sessions have session " << p->second << dendl;
-      continue;
-    }
-    */
     if (session->is_opening()) {
       dout(10) << "force_open_sessions opening " << session->inst << dendl;
       session->state = Session::STATE_OPEN;
index d3e8cb0dc1b9ad9463b1de1d8fa630fd6aeb2634..43ea543037b6d2ffc6c8905341d5fb473513474a 100644 (file)
@@ -145,11 +145,8 @@ public:
         p != client_map.end(); 
         ++p) {
       Session *session = get_or_add_session(p->second);
-      if (session->state == Session::STATE_UNDEF ||
-         session->state == Session::STATE_CLOSING) {
-       session->inst = p->second;
-       session->state = Session::STATE_OPEN;
-      }
+      session->inst = p->second;
+      session->state = Session::STATE_OPEN;
     }
     version++;
   }
index 89534f12b51bfddc6a9ef0fe8dca722678430d45..f7b247eec16e8abca2c0ea53198dbe63e4846be1 100644 (file)
@@ -54,8 +54,6 @@ public:
     ::_decode(bounds, bl, off);
   }
   
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 
 };
index 64969111193c05288666212c9a3d3a141f5d32a6..e47fdb82be2696f975478d941b4d4358dbff68f1 100644 (file)
@@ -46,8 +46,6 @@ public:
     metablob._decode(bl, off);
   }
 
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 };
 
index 0ee6d71ffdc1344618768f121bf609d5889a650e..91f5069514c6d877367eba96182ed549ca27436b 100644 (file)
@@ -51,8 +51,6 @@ class EImportFinish : public LogEvent {
     off += sizeof(success);
   }
   
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 
 };
index 5671e404298a4cd2cb6b897dd599b64ef9586438..2c48cd5366a3a845050c49be0a810842b5fb8500 100644 (file)
@@ -58,8 +58,6 @@ protected:
     ::_decode(client_map, bl, off);
   }
   
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 
 };
index 767521523f9fef0c7847a9f085cd9e83cffac344..0168f42e039c688b63936207e45df7579b8e0718 100644 (file)
@@ -487,8 +487,6 @@ private:
     out << "]";
   }
 
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void update_segment(LogSegment *ls);
   void replay(MDS *mds, LogSegment *ls=0);
 };
index dff0101b7699a21efed848bf39d00519fcab72f7..6f8d2543c33ea7c7073a1b113e3075afc50fb714 100644 (file)
@@ -45,8 +45,6 @@ class EPurgeFinish : public LogEvent {
     ::_decode(oldsize, bl, off);
   }
   
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void update_segment();
   void replay(MDS *mds);
 };
index 3aba5559aac1ccb217794d301c5a35063fdf97fc..b8a3b857d0e90e748ed872fd7bdf21326882d208 100644 (file)
@@ -55,8 +55,6 @@ class ESession : public LogEvent {
       out << "ESession " << client_inst << " close cmapv " << cmapv;
   }
   
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void update_segment();
   void replay(MDS *mds);  
 };
index 54eaef9c6a29641553bebfe527ebfbd86fdc586d..2f289ca1649f580004c646cd65f660b3e09c5beb 100644 (file)
@@ -71,8 +71,6 @@ public:
     rollback._decode(bl, off);
   }
 
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 };
 
index b292f9927d76f87e5706125977320e7a5e4c62c0..c22c22b38191e06f7e98e46a308116a412109db7 100644 (file)
@@ -47,8 +47,6 @@ class EString : public LogEvent {
     out << '"' << event << '"';
   }
 
-  bool has_expired(MDS *mds);
-  void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 
 };
index cb6feb1d92ec6d16d568bb29255a214a56f97fc2..80838114f50f418703d5ca1cc0e54a665d0b1d4e 100644 (file)
@@ -39,8 +39,6 @@ public:
     ::_decode(subtrees, bl, off);
   }
 
-  //bool has_expired(MDS *mds);
-  //void expire(MDS *mds, Context *c);
   void replay(MDS *mds);
 };
 
index 4e1b50b3a4cb547731853c204e088df64850df78..48987f832c31206bc90a83b44948406a703b0ebd 100644 (file)
@@ -208,14 +208,6 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
 // -----------------------
 // EString
 
-bool EString::has_expired(MDS *mds) {
-  dout(10) << "EString.has_expired " << event << dendl; 
-  return true;
-}
-void EString::expire(MDS *mds, Context *c)
-{
-  dout(10) << "EString.expire " << event << dendl; 
-}
 void EString::replay(MDS *mds)
 {
   dout(10) << "EString.replay " << event << dendl; 
@@ -232,290 +224,6 @@ EMetaBlob::EMetaBlob(MDLog *mdlog) :
 {
 }
 
-
-/*
- * we need to ensure that a journaled item has either
- * 
- * - been safely committed to its dirslice.
- *
- * - has been safely exported.  i.e., authority().first != us.  
- *   in particular, auth of <us, them> is not enough, we need to
- *   wait for <them,-2>.  
- *
- * note that this check is overly conservative, in that we'll
- * try to flush the dir again if we reimport the subtree, even though
- * later journal entries contain the same dirty data (from the import).
- *
- */
-bool EMetaBlob::has_expired(MDS *mds)
-{
-/*
-  // examine dirv's for my lumps
-  for (map<dirfrag_t,dirlump>::iterator lp = lump_map.begin();
-       lp != lump_map.end();
-       ++lp) {
-    CDir *dir = mds->mdcache->get_dirfrag(lp->first);
-    if (!dir) 
-      continue;       // we expired it
-
-    // FIXME: check the slice only
-
-    if (dir->authority().first != mds->get_nodeid()) {
-      dout(10) << "EMetaBlob.has_expired not auth, needed dirv " << lp->second.dirv
-              << " for " << *dir << dendl;
-      continue;       // not our problem
-    }
-
-    if (g_conf.mds_hack_log_expire_for_better_stats) {
-      // FIXME HACK: this makes logger stats more accurage, for journal stats, 
-      //             but is not perfectly safe.  for benchmarking ONLY!
-      if (dir->get_committing_version() >= lp->second.dirv ||   // committING, not committED.
-         dir->get_committed_version_equivalent() >= lp->second.dirv) {
-       dout(10) << "EMetaBlob.has_expired have|committING (unsafe hack!) dirv " << lp->second.dirv
-                << " for " << *dir << dendl;
-       continue;       // yay
-      }
-    } else {
-      // this is the proper (safe) way
-      if (dir->get_committed_version() >= lp->second.dirv ||
-         dir->get_committed_version_equivalent() >= lp->second.dirv) {
-       dout(10) << "EMetaBlob.has_expired have dirv " << lp->second.dirv
-                << " for " << *dir << dendl;
-       continue;       // yay
-      }
-    }
-    
-    if (dir->is_ambiguous_dir_auth()) {
-      CDir *ex = mds->mdcache->get_subtree_root(dir);
-      if (ex->is_exporting()) {
-       // wait until export is acked (logged on remote) and committed (logged locally)
-       dout(10) << "EMetaBlob.has_expired ambiguous auth for " << *dir
-                << ", exporting on " << *ex << dendl;
-       return false;
-      } else {
-       dout(10) << "EMetaBlob.has_expired ambiguous auth for " << *dir
-                << ", importing on " << *ex << dendl;
-       return false;
-      }
-    }
-
-    if (dir->get_committed_version() < lp->second.dirv) {
-      dout(10) << "EMetaBlob.has_expired need dirv " << lp->second.dirv
-              << " for " << *dir << dendl;
-      return false;  // not committed.
-    }
-
-    assert(0);  // i goofed the logic
-  }
-
-  // have my anchortable ops committed?
-  for (list<version_t>::iterator p = atids.begin();
-       p != atids.end();
-       ++p) {
-    if (!mds->anchorclient->has_committed(*p)) {
-      dout(10) << "EMetaBlob.has_expired anchor transaction " << *p 
-              << " not yet acked" << dendl;
-      return false;
-    }
-  }
-  
-  if (!dirty_inode_mtimes.empty())
-    for (map<inodeno_t,utime_t>::iterator p = dirty_inode_mtimes.begin();
-        p != dirty_inode_mtimes.end();
-        ++p) {
-      CInode *in = mds->mdcache->get_inode(p->first);
-      if (in) {
-       if (in->inode.ctime == p->second &&
-           in->dirlock.is_updated()) {
-         dout(10) << "EMetaBlob.has_expired dirty mtime dirlock hasn't flushed on " << *in << dendl;
-         return false;
-       }
-      }
-    }
-
-  // allocated_ios
-  if (!allocated_inos.empty()) {
-    version_t cv = mds->idalloc->get_committed_version();
-    if (cv < alloc_tablev) {
-      dout(10) << "EMetaBlob.has_expired idalloc tablev " << alloc_tablev << " > " << cv
-              << ", still dirty" << dendl;
-      return false;   // still dirty
-    } else {
-      dout(10) << "EMetaBlob.has_expired idalloc tablev " << alloc_tablev << " <= " << cv
-              << ", already flushed" << dendl;
-    }
-  }
-
-
-  // truncated inodes
-  for (list< pair<inode_t,off_t> >::iterator p = truncated_inodes.begin();
-       p != truncated_inodes.end();
-       ++p) {
-    if (mds->mdcache->is_purging(p->first.ino, p->second)) {
-      dout(10) << "EMetaBlob.has_expired still purging inode " << p->first.ino 
-              << " to " << p->second << dendl;
-      return false;
-    }
-  }  
-
-  // client requests
-  for (list<metareqid_t>::iterator p = client_reqs.begin();
-       p != client_reqs.end();
-       ++p) {
-    if (mds->sessionmap.have_completed_request(*p)) {
-      dout(10) << "EMetaBlob.has_expired still have completed request " << *p
-              << dendl;
-      return false;
-    }
-  }
-
-  
-  */
-  return true;  // all dirlumps expired, etc.
-}
-
-
-void EMetaBlob::expire(MDS *mds, Context *c)
-{
-/*
-  map<CDir*,version_t> commit;  // dir -> version needed
-  list<CDir*> waitfor_export;
-  list<CDir*> waitfor_import;
-  int ncommit = 0;
-
-  // examine dirv's for my lumps
-  // make list of dir slices i need to commit
-  for (map<dirfrag_t,dirlump>::iterator lp = lump_map.begin();
-       lp != lump_map.end();
-       ++lp) {
-    CDir *dir = mds->mdcache->get_dirfrag(lp->first);
-    if (!dir) 
-      continue;       // we expired it
-    
-    // FIXME: check the slice only
-
-    if (dir->authority().first != mds->get_nodeid()) {
-      dout(10) << "EMetaBlob.expire not auth, needed dirv " << lp->second.dirv
-              << " for " << *dir << dendl;
-      continue;     // not our problem
-    }
-    if (dir->get_committed_version() >= lp->second.dirv ||
-       dir->get_committed_version_equivalent() >= lp->second.dirv) {
-      dout(10) << "EMetaBlob.expire have dirv " << lp->second.dirv
-              << " on " << *dir << dendl;
-      continue;   // yay
-    }
-    
-    if (dir->is_ambiguous_dir_auth()) {
-      CDir *ex = mds->mdcache->get_subtree_root(dir);
-      if (ex->is_exporting()) {
-       // wait until export is acked (logged on remote) and committed (logged locally)
-       dout(10) << "EMetaBlob.expire ambiguous auth for " << *dir
-                << ", waiting for export finish on " << *ex << dendl;
-       waitfor_export.push_back(ex);
-       continue;
-      } else {
-       dout(10) << "EMetaBlob.expire ambiguous auth for " << *dir
-                << ", waiting for import finish on " << *ex << dendl;
-       waitfor_import.push_back(ex);
-       continue;
-      }
-    }
-    
-    assert(dir->get_committed_version() < lp->second.dirv);
-    dout(10) << "EMetaBlob.expire need dirv " << lp->second.dirv
-            << ", committing " << *dir << dendl;
-    commit[dir] = MAX(commit[dir], lp->second.dirv);
-    ncommit++;
-  }
-
-  // set up gather context
-  C_Gather *gather = new C_Gather(c);
-
-  // do or wait for exports and commits
-  for (map<CDir*,version_t>::iterator p = commit.begin();
-       p != commit.end();
-       ++p) {
-    if (p->first->can_auth_pin())
-      p->first->commit(p->second, gather->new_sub());
-    else
-      // pbly about to export|split|merge. 
-      // just wait for it to unfreeze, then retry
-      p->first->add_waiter(CDir::WAIT_UNFREEZE, gather->new_sub());  
-  }
-  for (list<CDir*>::iterator p = waitfor_export.begin();
-       p != waitfor_export.end();
-       ++p) 
-    mds->mdcache->migrator->add_export_finish_waiter(*p, gather->new_sub());
-  for (list<CDir*>::iterator p = waitfor_import.begin();
-       p != waitfor_import.end();
-       ++p) 
-    (*p)->add_waiter(CDir::WAIT_UNFREEZE, gather->new_sub());
-  
-
-  // have my anchortable ops committed?
-  for (list<version_t>::iterator p = atids.begin();
-       p != atids.end();
-       ++p) {
-    if (!mds->anchorclient->has_committed(*p)) {
-      dout(10) << "EMetaBlob.expire anchor transaction " << *p 
-              << " not yet acked, waiting" << dendl;
-      mds->anchorclient->wait_for_ack(*p, gather->new_sub());
-    }
-  }
-
-  // dirtied inode mtimes
-  if (!dirty_inode_mtimes.empty())
-    for (map<inodeno_t,utime_t>::iterator p = dirty_inode_mtimes.begin();
-        p != dirty_inode_mtimes.end();
-        ++p) {
-      CInode *in = mds->mdcache->get_inode(p->first);
-      if (in) {
-       if (in->inode.ctime == p->second &&
-           in->dirlock.is_updated()) {
-         dout(10) << "EMetaBlob.expire dirty mtime dirlock hasn't flushed, waiting on " 
-                  << *in << dendl;
-         in->dirlock.add_waiter(SimpleLock::WAIT_STABLE, gather->new_sub());
-       }
-      }
-    }
-
-  // allocated_inos
-  if (!allocated_inos.empty()) {
-    version_t cv = mds->idalloc->get_committed_version();
-    if (cv < alloc_tablev) {
-      dout(10) << "EMetaBlob.expire saving idalloc table, need " << alloc_tablev << dendl;
-      mds->idalloc->save(gather->new_sub(), alloc_tablev);
-    }
-  }
-
-  // truncated inodes
-  for (list< pair<inode_t,off_t> >::iterator p = truncated_inodes.begin();
-       p != truncated_inodes.end();
-       ++p) {
-    if (mds->mdcache->is_purging(p->first.ino, p->second)) {
-      dout(10) << "EMetaBlob.expire waiting for purge of inode " << p->first.ino
-              << " to " << p->second << dendl;
-      mds->mdcache->wait_for_purge(p->first.ino, p->second, gather->new_sub());
-    }
-  }
-
-  // client requests
-  for (list<metareqid_t>::iterator p = client_reqs.begin();
-       p != client_reqs.end();
-       ++p) {
-    if (mds->sessionmap.have_completed_request(*p)) {
-      dout(10) << "EMetaBlob.expire waiting on completed request " << *p
-              << dendl;
-      mds->sessionmap.add_trim_waiter(*p, gather->new_sub());
-    }
-  }
-
-  dout(10) << "my gather finsher is " << gather << " with " << gather->get_num() << dendl;
-
-*/
-}
-
 void EMetaBlob::update_segment(LogSegment *ls)
 {
   // atids?
@@ -993,16 +701,6 @@ void EFragment::replay(MDS *mds)
 // EPurgeFinish
 
 
-bool EPurgeFinish::has_expired(MDS *mds)
-{
-  return true;
-}
-
-void EPurgeFinish::expire(MDS *mds, Context *c)
-{
-  assert(0);
-}
-
 void EPurgeFinish::update_segment()
 {
   // ** update purge lists?
@@ -1025,26 +723,6 @@ void EPurgeFinish::replay(MDS *mds)
 // -----------------------
 // EExport
 
-bool EExport::has_expired(MDS *mds)
-{
-  CDir *dir = mds->mdcache->get_dirfrag(base);
-  if (dir && mds->mdcache->migrator->is_exporting(dir)) {
-    dout(10) << "EExport.has_expired still exporting " << *dir << dendl;
-    return false;
-  }
-  return true;
-}
-
-void EExport::expire(MDS *mds, Context *c)
-{
-  CDir *dir = mds->mdcache->get_dirfrag(base);
-  assert(dir);
-  assert(mds->mdcache->migrator->is_exporting(dir));
-
-  dout(10) << "EExport.expire waiting for export of " << *dir << dendl;
-  mds->mdcache->migrator->add_export_finish_waiter(dir, c);
-}
-
 void EExport::replay(MDS *mds)
 {
   dout(10) << "EExport.replay " << base << dendl;
@@ -1098,15 +776,6 @@ void EImportStart::replay(MDS *mds)
 // -----------------------
 // EImportFinish
 
-bool EImportFinish::has_expired(MDS *mds)
-{
-  return true;
-}
-void EImportFinish::expire(MDS *mds, Context *c)
-{
-  assert(0);  // shouldn't ever happen
-}
-
 void EImportFinish::replay(MDS *mds)
 {
   if (mds->mdcache->have_ambiguous_import(base)) {