]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: disable fd cacher and wbthrottle during replay
authorSamuel Just <sam.just@inktank.com>
Mon, 22 Jul 2013 19:41:40 +0000 (12:41 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 22 Jul 2013 22:10:46 +0000 (15:10 -0700)
The fd cache only works correctly when there is at most 1
inode per hobject_t.  This condition is frequently violated
during replay.

Fixes: #5699
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/os/FDCache.h
src/os/FileStore.cc

index cf07f860aa50e7574ef2e61d9af84449558000a8..f0f40e7bbf41b9f8fb481c7bce097a47024c6ca8 100644 (file)
@@ -28,6 +28,7 @@
  * FD Cache
  */
 class FDCache : public md_config_obs_t {
+public:
   /**
    * FD
    *
@@ -47,8 +48,10 @@ class FDCache : public md_config_obs_t {
     }
   };
 
+private:
   SharedLRU<hobject_t, FD> registry;
   CephContext *cct;
+
 public:
   FDCache(CephContext *cct) : cct(cct) {
     assert(cct);
index 10f2b1f2aad4507c6280537dab39f9663cdda386..17105c11d69b0b7b147fa2287c2e0b0542eef388 100644 (file)
@@ -220,7 +220,8 @@ int FileStore::lfn_open(coll_t cid,
     r = get_index(cid, index);
   }
   Mutex::Locker l(fdcache_lock);
-  *outfd = fdcache.lookup(oid);
+  if (!replaying)
+    *outfd = fdcache.lookup(oid);
   if (*outfd) {
     return 0;
   }
@@ -258,7 +259,10 @@ int FileStore::lfn_open(coll_t cid,
       goto fail;
     }
   }
-  *outfd = fdcache.add(oid, fd);
+  if (!replaying)
+    *outfd = fdcache.add(oid, fd);
+  else
+    *outfd = FDRef(new FDCache::FD(fd));
   return 0;
 
  fail:
@@ -3060,7 +3064,8 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
     r = bl.length();
 
   // flush?
-  wbthrottle.queue_wb(fd, oid, offset, len, replica);
+  if (!replaying)
+    wbthrottle.queue_wb(fd, oid, offset, len, replica);
   lfn_close(fd);
 
  out: