From 033881561cfe84aed23e67d0e472c5b94c7022f9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 31 Dec 2007 15:37:29 -0800 Subject: [PATCH] removed old has_expired/expired log event cruft --- src/mds/Server.cc | 14 -- src/mds/SessionMap.h | 7 +- src/mds/events/EExport.h | 2 - src/mds/events/EFragment.h | 2 - src/mds/events/EImportFinish.h | 2 - src/mds/events/EImportStart.h | 2 - src/mds/events/EMetaBlob.h | 2 - src/mds/events/EPurgeFinish.h | 2 - src/mds/events/ESession.h | 2 - src/mds/events/ESlaveUpdate.h | 2 - src/mds/events/EString.h | 2 - src/mds/events/ESubtreeMap.h | 2 - src/mds/journal.cc | 331 --------------------------------- 13 files changed, 2 insertions(+), 370 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 2e5ae550cc207..29e9e37b61693 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -218,9 +218,6 @@ void Server::_session_logged(Session *session, bool open, version_t pv) void Server::prepare_force_open_sessions(map& 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& cm) for (map::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; diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index d3e8cb0dc1b9a..43ea543037b6d 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -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++; } diff --git a/src/mds/events/EExport.h b/src/mds/events/EExport.h index 89534f12b51bf..f7b247eec16e8 100644 --- a/src/mds/events/EExport.h +++ b/src/mds/events/EExport.h @@ -54,8 +54,6 @@ public: ::_decode(bounds, bl, off); } - bool has_expired(MDS *mds); - void expire(MDS *mds, Context *c); void replay(MDS *mds); }; diff --git a/src/mds/events/EFragment.h b/src/mds/events/EFragment.h index 64969111193c0..e47fdb82be269 100644 --- a/src/mds/events/EFragment.h +++ b/src/mds/events/EFragment.h @@ -46,8 +46,6 @@ public: metablob._decode(bl, off); } - bool has_expired(MDS *mds); - void expire(MDS *mds, Context *c); void replay(MDS *mds); }; diff --git a/src/mds/events/EImportFinish.h b/src/mds/events/EImportFinish.h index 0ee6d71ffdc13..91f5069514c6d 100644 --- a/src/mds/events/EImportFinish.h +++ b/src/mds/events/EImportFinish.h @@ -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); }; diff --git a/src/mds/events/EImportStart.h b/src/mds/events/EImportStart.h index 5671e404298a4..2c48cd5366a3a 100644 --- a/src/mds/events/EImportStart.h +++ b/src/mds/events/EImportStart.h @@ -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); }; diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 767521523f9fe..0168f42e039c6 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -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); }; diff --git a/src/mds/events/EPurgeFinish.h b/src/mds/events/EPurgeFinish.h index dff0101b7699a..6f8d2543c33ea 100644 --- a/src/mds/events/EPurgeFinish.h +++ b/src/mds/events/EPurgeFinish.h @@ -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); }; diff --git a/src/mds/events/ESession.h b/src/mds/events/ESession.h index 3aba5559aac1c..b8a3b857d0e90 100644 --- a/src/mds/events/ESession.h +++ b/src/mds/events/ESession.h @@ -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); }; diff --git a/src/mds/events/ESlaveUpdate.h b/src/mds/events/ESlaveUpdate.h index 54eaef9c6a296..2f289ca1649f5 100644 --- a/src/mds/events/ESlaveUpdate.h +++ b/src/mds/events/ESlaveUpdate.h @@ -71,8 +71,6 @@ public: rollback._decode(bl, off); } - bool has_expired(MDS *mds); - void expire(MDS *mds, Context *c); void replay(MDS *mds); }; diff --git a/src/mds/events/EString.h b/src/mds/events/EString.h index b292f9927d76f..c22c22b38191e 100644 --- a/src/mds/events/EString.h +++ b/src/mds/events/EString.h @@ -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); }; diff --git a/src/mds/events/ESubtreeMap.h b/src/mds/events/ESubtreeMap.h index cb6feb1d92ec6..80838114f50f4 100644 --- a/src/mds/events/ESubtreeMap.h +++ b/src/mds/events/ESubtreeMap.h @@ -39,8 +39,6 @@ public: ::_decode(subtrees, bl, off); } - //bool has_expired(MDS *mds); - //void expire(MDS *mds, Context *c); void replay(MDS *mds); }; diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 4e1b50b3a4cb5..48987f832c312 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -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 is not enough, we need to - * wait for . - * - * 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::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::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::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 >::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::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 commit; // dir -> version needed - list waitfor_export; - list waitfor_import; - int ncommit = 0; - - // examine dirv's for my lumps - // make list of dir slices i need to commit - for (map::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::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::iterator p = waitfor_export.begin(); - p != waitfor_export.end(); - ++p) - mds->mdcache->migrator->add_export_finish_waiter(*p, gather->new_sub()); - for (list::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::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::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 >::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::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)) { -- 2.39.5