From e30b0f550f7749160d0ad865d95aa6e40991072a Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 14 Nov 2007 22:19:06 +0000 Subject: [PATCH] random crap git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2067 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/sage/mds/TODO | 29 ++++------------------------ branches/sage/mds/include/types.h | 1 + branches/sage/mds/mds/CInode.cc | 16 ++++++++++------ branches/sage/mds/mds/CInode.h | 2 +- branches/sage/mds/mds/MDCache.cc | 32 +++++++++++++++++++++++-------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/branches/sage/mds/TODO b/branches/sage/mds/TODO index c970620074d9f..1b03b7f450243 100644 --- a/branches/sage/mds/TODO +++ b/branches/sage/mds/TODO @@ -32,36 +32,15 @@ code cleanup - word size - clean up all encoded structures -general kernel planning -- soft consistency on (kernel) lookup? -- accurate reconstruction of (syscall) path? - - - -sage doc -- mdsmonitor beacon semantics -- cache expiration, cache invariants - - including dual expire states, transition, vs subtree grouping of expire messages -- recovery states, implicit barrier are rejoin -- journal content - - importmaps and up:resolve -- metablob version semantics - - -mdsmon -- per-mds, shared standby queues - - - mds bugs -/- stray migration -/ - purge on shutdown - rename slave in-memory rollback on failure -- fix purge_stray bug -- try_remove_unlinked_dn thing - proper handling of cache expire messages during rejoin phase? + -> i think cache expires are fine; the rejoin_ack handler just has to behave if rejoining items go missing +- try_remove_unlinked_dn thing + +- rerun destro trace against latest, with various journal lengths mds - stray reintegration diff --git a/branches/sage/mds/include/types.h b/branches/sage/mds/include/types.h index 39f6afdf2376f..e394a27559636 100644 --- a/branches/sage/mds/include/types.h +++ b/branches/sage/mds/include/types.h @@ -200,6 +200,7 @@ struct inode_t { int64_t size, max_size, allocated_size; utime_t mtime; // file data modify time. utime_t atime; // file data access time. + utime_t rmtime; // recursive mtime // special stuff version_t version; // auth only diff --git a/branches/sage/mds/mds/CInode.cc b/branches/sage/mds/mds/CInode.cc index cb436254de13e..4320750c50eb8 100644 --- a/branches/sage/mds/mds/CInode.cc +++ b/branches/sage/mds/mds/CInode.cc @@ -494,8 +494,10 @@ void CInode::encode_lock_state(int type, bufferlist& bl) list dfls; get_dirfrags(dfls); for (list::iterator p = dfls.begin(); p != dfls.end(); ++p) - if ((*p)->is_auth()) - myfrags.insert((*p)->get_frag()); + if ((*p)->is_auth()) { + frag_t fg = (*p)->get_frag(); + myfrags.insert(fg); + } _encode(myfrags, bl); } break; @@ -509,13 +511,15 @@ void CInode::encode_lock_state(int type, bufferlist& bl) case LOCK_OTYPE_IDIR: _encode(inode.mtime, bl); if (0) { - map dfsz; + map frag_sizes; for (map::iterator p = dirfrags.begin(); p != dirfrags.end(); ++p) - if (p->second->is_auth()) - dfsz[p->first] = p->second->get_nitems(); - _encode(dfsz, bl); + if (p->second->is_auth()) { + //frag_t fg = (*p)->get_frag(); + //frag_sizes[f] = dirfrag_size[fg]; + } + _encode(frag_sizes, bl); } break; diff --git a/branches/sage/mds/mds/CInode.h b/branches/sage/mds/mds/CInode.h index 7397dec1e3909..b6da550a8d7b4 100644 --- a/branches/sage/mds/mds/CInode.h +++ b/branches/sage/mds/mds/CInode.h @@ -130,7 +130,7 @@ class CInode : public MDSCacheObject { inode_t inode; // the inode itself string symlink; // symlink dest, if symlink fragtree_t dirfragtree; // dir frag tree, if any. always consistent with our dirfrag map. - //map dirfrag_size; // size of each dirfrag + map dirfrag_size; // size of each dirfrag off_t last_journaled; // log offset for the last time i was journaled off_t last_open_journaled; // log offset for the last journaled EOpen diff --git a/branches/sage/mds/mds/MDCache.cc b/branches/sage/mds/mds/MDCache.cc index 59a7008d4af9d..2ac319a4d439a 100644 --- a/branches/sage/mds/mds/MDCache.cc +++ b/branches/sage/mds/mds/MDCache.cc @@ -2382,7 +2382,7 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack) p != ack->strong_dirfrags.end(); ++p) { CDir *dir = get_dirfrag(p->first); - if (!dir) continue; + if (!dir) continue; // must have trimmed? dir->set_replica_nonce(p->second.nonce); dir->state_clear(CDir::STATE_REJOINING); @@ -2393,7 +2393,7 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack) q != ack->strong_dentries[p->first].end(); ++q) { CDentry *dn = dir->lookup(q->first); - if (!dn) continue; + if (!dn) continue; // must have trimmed? // hmm, did we have the proper linkage here? if (dn->is_null() && @@ -2414,7 +2414,13 @@ void MDCache::handle_cache_rejoin_ack(MMDSCacheRejoin *ack) else if (!dn->is_null() && q->second.is_null()) { dout(-10) << " had bad linkage for " << *dn << dendl; - assert(0); // hrmpf. unlink should use slave requests to clean this up during resolve. + /* + * this should happen: + * if we're a survivor, any unlink should commit or rollback during + * the resolve stage. + * if we failed, we shouldn't have non-auth leaf dentries at all + */ + assert(0); // uh oh. } dn->set_replica_nonce(q->second.nonce); mds->locker->rejoin_set_state(&dn->lock, q->second.lock, waiters); @@ -2932,6 +2938,11 @@ void MDCache::start_recovered_purges() // cache trimming +/* + * note: only called while MDS is active or stopping... NOT during recovery. + * however, we may expire a replica whose authority is recovering. + * + */ bool MDCache::trim(int max) { // trim LRU @@ -3317,7 +3328,8 @@ void MDCache::handle_cache_expire(MCacheExpire *m) int nonce = it->second; if (!in) { - dout(0) << " inode expire on " << it->first << " from " << from << ", don't have it" << dendl; + dout(0) << " inode expire on " << it->first << " from " << from + << ", don't have it" << dendl; assert(in); } assert(in->is_auth()); @@ -3325,13 +3337,15 @@ void MDCache::handle_cache_expire(MCacheExpire *m) // check nonce if (nonce == in->get_replica_nonce(from)) { // remove from our cached_by - dout(7) << " inode expire on " << *in << " from mds" << from << " cached_by was " << in->get_replicas() << dendl; + dout(7) << " inode expire on " << *in << " from mds" << from + << " cached_by was " << in->get_replicas() << dendl; inode_remove_replica(in, from); } else { // this is an old nonce, ignore expire. dout(7) << " inode expire on " << *in << " from mds" << from - << " with old nonce " << nonce << " (current " << in->get_replica_nonce(from) << "), dropping" + << " with old nonce " << nonce + << " (current " << in->get_replica_nonce(from) << "), dropping" << dendl; assert(in->get_replica_nonce(from) > nonce); } @@ -3345,7 +3359,8 @@ void MDCache::handle_cache_expire(MCacheExpire *m) int nonce = it->second; if (!dir) { - dout(0) << " dir expire on " << it->first << " from " << from << ", don't have it" << dendl; + dout(0) << " dir expire on " << it->first << " from " << from + << ", don't have it" << dendl; assert(dir); } assert(dir->is_auth()); @@ -3376,7 +3391,8 @@ void MDCache::handle_cache_expire(MCacheExpire *m) CDir *dir = diri->get_dirfrag(pd->first.frag); if (!dir) { - dout(0) << " dn expires on " << pd->first << " from " << from << ", must have refragmented" << dendl; + dout(0) << " dn expires on " << pd->first << " from " << from + << ", must have refragmented" << dendl; } else { assert(dir->is_auth()); } -- 2.39.5