From: Samuel Just Date: Mon, 22 Jul 2013 19:41:40 +0000 (-0700) Subject: FileStore: disable fd cacher and wbthrottle during replay X-Git-Tag: v0.67-rc2~19^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6582b31abcb36a355b96d63c03ac17021c1e591f;p=ceph.git FileStore: disable fd cacher and wbthrottle during replay 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 Reviewed-by: Sage Weil --- diff --git a/src/os/FDCache.h b/src/os/FDCache.h index cf07f860aa50..f0f40e7bbf41 100644 --- a/src/os/FDCache.h +++ b/src/os/FDCache.h @@ -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 registry; CephContext *cct; + public: FDCache(CephContext *cct) : cct(cct) { assert(cct); diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 10f2b1f2aad4..17105c11d69b 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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: