]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: tolerate EEXIST on mkcoll when not-btrfs
authorSage Weil <sage@newdream.net>
Tue, 18 Oct 2011 21:13:11 +0000 (14:13 -0700)
committerSage Weil <sage@newdream.net>
Tue, 18 Oct 2011 23:52:13 +0000 (16:52 -0700)
For non-btrfs file systems we should tolerate EEXIST because we may
replay the event more than once.

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/FileStore.cc
src/os/JournalingObjectStore.cc
src/os/JournalingObjectStore.h

index 200151bc66a4c00dd9d2620a6d6305c1e898a964..a975d65871debd359dc50f7069da1c854fe92e67 100644 (file)
@@ -2440,6 +2440,9 @@ unsigned FileStore::_do_transaction(Transaction& t)
     else if (r == -ENOTEMPTY) {
       assert(0 == "ENOTEMPTY suggests garbage data in osd data dir");
     }
+    else if (r == -EEXIST && op == Transaction::OP_MKCOLL && replaying && !btrfs) {
+      dout(10) << "tolerating EEXIST during journal replay on non-btrfs" << dendl;
+    }
     else if (r < 0) {
       dout(0) << " error " << cpp_strerror(r) << " not handled" << dendl;
       assert(0 == "unexpected error");
index c41d505bfa7545d5e54ae5463c1f5f046a92e443..1dc42698ab57365cc69e1d2cabdad5b177446853 100644 (file)
@@ -47,6 +47,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
     return err;
   }
 
+  replaying = true;
+
   int count = 0;
   while (1) {
     bufferlist bl;
@@ -81,6 +83,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
     seq++;  // we expect the next op
   }
 
+  replaying = false;
+
   applied_seq = op_seq;
 
   // done reading, make writeable.
index a04feec55763e5409db86ad26c1919cbc9fa4abf..b6342b8ba48cfeca537761189e0020480993bd17 100644 (file)
@@ -38,6 +38,8 @@ protected:
   list<uint64_t> ops_submitting;
   list<Cond*> ops_apply_blocked;
 
+  bool replaying;
+
 protected:
   void journal_start();
   void journal_stop();
@@ -71,7 +73,8 @@ public:
                            open_ops(0), blocked(false),
                            journal(NULL), finisher(g_ceph_context),
                            journal_lock("JournalingObjectStore::journal_lock"),
-                           com_lock("JournalingObjectStore::com_lock") { }
+                           com_lock("JournalingObjectStore::com_lock"),
+                           replaying(false) { }
   
 };