Skip to content

Commit

Permalink
os/bluestore: do not assign already cached buffer to
Browse files Browse the repository at this point in the history
mempool_bluestore_writing.

This spoils mempool stats with unexpectedly high mount of entries in
the bluestore_writing mempool.
The issue might occurs while handling partial overwrites in EC pools.
Unser some circumstances EC backend might rewrite data from read cache back to disk.

Signed-off-by: Igor Fedotov <[email protected]>
  • Loading branch information
ifed01 committed Oct 8, 2020
1 parent 98a8f53 commit 050873f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,13 @@ class BlueStore : public ObjectStore,
ceph_assert(writing.empty());
}

void _add_buffer(BufferCacheShard* cache, Buffer *b, int level, Buffer *near) {
void _add_buffer(BufferCacheShard* cache, Buffer* b, int level, Buffer* near) {
cache->_audit("_add_buffer start");
buffer_map[b->offset].reset(b);
if (b->is_writing()) {
b->data.reassign_to_mempool(mempool::mempool_bluestore_writing);
// we might get already cached data for which resetting mempool is inppropriate
// hence calling try_assign_to_mempool
b->data.try_assign_to_mempool(mempool::mempool_bluestore_writing);
if (writing.empty() || writing.rbegin()->seq <= b->seq) {
writing.push_back(*b);
} else {
Expand All @@ -316,8 +318,8 @@ class BlueStore : public ObjectStore,
writing.insert(it, *b);
}
} else {
b->data.reassign_to_mempool(mempool::mempool_bluestore_cache_data);
cache->_add(b, level, near);
b->data.reassign_to_mempool(mempool::mempool_bluestore_cache_data);
cache->_add(b, level, near);
}
cache->_audit("_add_buffer end");
}
Expand Down

0 comments on commit 050873f

Please sign in to comment.