summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-07-22 12:41:40 -0700
committerSamuel Just <sam.just@inktank.com>2013-07-22 15:10:46 -0700
commit6582b31abcb36a355b96d63c03ac17021c1e591f (patch)
tree5d0923f5d7dbbbe0e5793c687bd87609f50c6067
parent2fd4421707814d3563c84002d8b49b5a0c7a3dd5 (diff)
downloadceph-6582b31abcb36a355b96d63c03ac17021c1e591f.tar.gz
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 <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/os/FDCache.h3
-rw-r--r--src/os/FileStore.cc11
2 files changed, 11 insertions, 3 deletions
diff --git a/src/os/FDCache.h b/src/os/FDCache.h
index cf07f860aa5..f0f40e7bbf4 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<hobject_t, FD> registry;
CephContext *cct;
+
public:
FDCache(CephContext *cct) : cct(cct) {
assert(cct);
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 10f2b1f2aad..17105c11d69 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: