From 33ee1135d38580bdbe8d1cbf19e514396be5b3dc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 Nov 2008 08:57:19 -0800 Subject: [PATCH] mds: fix up completed_request handling during journal replay The completed_requests is handled separately from the session table itself, in that we may add completed requests to the table even when we may have loaded newer info. But the handling was a bit wrong. We make sure we only add completed requests if the session is already open... and remove the unnecessary trim (if the sessionmap is newer, the session is already closed, and thus we have no request info). --- src/mds/journal.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 06cf6de402e6a..f5dd5f64098e3 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -536,7 +536,8 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) ++p) if (p->name.is_client()) { dout(10) << "EMetaBlob.replay request " << *p << dendl; - mds->sessionmap.add_completed_request(*p); + if (mds->sessionmap.have_session(p->name)) + mds->sessionmap.add_completed_request(*p); } @@ -557,11 +558,6 @@ void ESession::replay(MDS *mds) if (mds->sessionmap.version >= cmapv) { dout(10) << "ESession.replay sessionmap " << mds->sessionmap.version << " >= " << cmapv << ", noop" << dendl; - - // hrm, this isn't very pretty. - if (!open) - mds->sessionmap.trim_completed_requests(client_inst.name, 0); - } else { dout(10) << "ESession.replay sessionmap " << mds->sessionmap.version << " < " << cmapv << " " << (open ? "open":"close") << dendl; -- 2.39.5