From 1cd3c4ab944c732e141750906d7212366320c779 Mon Sep 17 00:00:00 2001 From: sageweil Date: Fri, 25 May 2007 20:45:06 +0000 Subject: [PATCH] * fixed bug with multiple mds restarts (log ambiguous import success/failure) git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1379 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/sage/cephmds2/TODO | 16 ---------------- branches/sage/cephmds2/mds/Locker.cc | 2 +- branches/sage/cephmds2/mds/MDCache.cc | 3 +++ branches/sage/cephmds2/mds/SimpleLock.h | 12 ++++++------ branches/sage/cephmds2/mds/events/EExport.h | 2 +- .../sage/cephmds2/mds/events/EImportFinish.h | 2 +- 6 files changed, 12 insertions(+), 25 deletions(-) diff --git a/branches/sage/cephmds2/TODO b/branches/sage/cephmds2/TODO index e7717687cf222..72bb37d21098d 100644 --- a/branches/sage/cephmds2/TODO +++ b/branches/sage/cephmds2/TODO @@ -15,22 +15,6 @@ doc mds - finish multistage rejoin -- no lock messaging with down|recovering node.. - - SimpleLock - - replica -> auth : - - auth -> replica : skip before rejoin, we can lock (or unlock/sync) with impunity - - ScatterLock - - replica -> auth : - - auth -> replica : - - FileLock - - replica -> auth : - - auth -> replica : -??? - - - failure safe (above) - - export safe (ambiguous auth...) - - - trim_on_rejoin - more testing of failures + thrashing. diff --git a/branches/sage/cephmds2/mds/Locker.cc b/branches/sage/cephmds2/mds/Locker.cc index c9cfb2e6b9640..03d7ded0d09d9 100644 --- a/branches/sage/cephmds2/mds/Locker.cc +++ b/branches/sage/cephmds2/mds/Locker.cc @@ -949,7 +949,7 @@ void Locker::simple_eval(SimpleLock *lock) } lock->set_state(LOCK_LOCK); - lock->finish_waiters(SimpleLock::WAIT_STABLE); + lock->finish_waiters(SimpleLock::WAIT_STABLE|SimpleLock::WAIT_WR); } // stable -> sync? diff --git a/branches/sage/cephmds2/mds/MDCache.cc b/branches/sage/cephmds2/mds/MDCache.cc index 838ff5c1add1d..774028cc457b1 100644 --- a/branches/sage/cephmds2/mds/MDCache.cc +++ b/branches/sage/cephmds2/mds/MDCache.cc @@ -41,6 +41,7 @@ #include "events/ESlaveUpdate.h" #include "events/EString.h" #include "events/EPurgeFinish.h" +#include "events/EImportFinish.h" #include "messages/MGenericMessage.h" @@ -1199,9 +1200,11 @@ void MDCache::disambiguate_imports() if (dir->authority().first != CDIR_AUTH_UNKNOWN) { dout(10) << "ambiguous import auth known, must not be me " << *dir << endl; cancel_ambiguous_import(q->first); + mds->mdlog->submit_entry(new EImportFinish(dir, false)); } else { dout(10) << "ambiguous import auth unknown, must be me " << *dir << endl; finish_ambiguous_import(q->first); + mds->mdlog->submit_entry(new EImportFinish(dir, true)); } } assert(my_ambiguous_imports.empty()); diff --git a/branches/sage/cephmds2/mds/SimpleLock.h b/branches/sage/cephmds2/mds/SimpleLock.h index 163e84f7a17f0..bf7b671236329 100644 --- a/branches/sage/cephmds2/mds/SimpleLock.h +++ b/branches/sage/cephmds2/mds/SimpleLock.h @@ -29,12 +29,12 @@ inline const char *get_lock_type_name(int t) { switch (t) { - case LOCK_OTYPE_DN: return "dentry"; - case LOCK_OTYPE_IFILE: return "inode_file"; - case LOCK_OTYPE_IAUTH: return "inode_auth"; - case LOCK_OTYPE_ILINK: return "inode_link"; - case LOCK_OTYPE_IDIRFRAGTREE: return "inode_dirfragtree"; - case LOCK_OTYPE_IDIR: return "inode_dir"; + case LOCK_OTYPE_DN: return "dn"; + case LOCK_OTYPE_IFILE: return "ifile"; + case LOCK_OTYPE_IAUTH: return "iauth"; + case LOCK_OTYPE_ILINK: return "ilink"; + case LOCK_OTYPE_IDIRFRAGTREE: return "idft"; + case LOCK_OTYPE_IDIR: return "idir"; default: assert(0); } } diff --git a/branches/sage/cephmds2/mds/events/EExport.h b/branches/sage/cephmds2/mds/events/EExport.h index eaa6d8e4bcce7..98c68ec78dd1e 100644 --- a/branches/sage/cephmds2/mds/events/EExport.h +++ b/branches/sage/cephmds2/mds/events/EExport.h @@ -39,7 +39,7 @@ public: set &get_bounds() { return bounds; } void print(ostream& out) { - out << "export " << base << " " << metablob; + out << "EExport " << base << " " << metablob; } virtual void encode_payload(bufferlist& bl) { diff --git a/branches/sage/cephmds2/mds/events/EImportFinish.h b/branches/sage/cephmds2/mds/events/EImportFinish.h index 7d51c038f3fab..59a3a564571ca 100644 --- a/branches/sage/cephmds2/mds/events/EImportFinish.h +++ b/branches/sage/cephmds2/mds/events/EImportFinish.h @@ -32,7 +32,7 @@ class EImportFinish : public LogEvent { EImportFinish() : LogEvent(EVENT_IMPORTFINISH) { } void print(ostream& out) { - out << "import_finish " << base; + out << "EImportFinish " << base; if (success) out << " success"; else -- 2.39.5