From 3befb062c7acc53b21c64095737dea55c9dec5b1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 20 Jun 2017 11:56:08 -0400 Subject: [PATCH] os/bluestore: move sharedblob to new collection in same shard We have to move the SharedBlob to the new collection even if the new collection is part of the same cache shard. It's only the buffers that need to be conditioned on the shard. Fixes: http://tracker.ceph.com/issues/20358 Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2d347996622..b4cf2735590 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3238,12 +3238,13 @@ void BlueStore::Collection::split_cache( } ldout(store->cct, 20) << __func__ << " moving " << *sb << dendl; sb->coll = dest; + if (sb->get_sbid()) { + ldout(store->cct, 20) << __func__ + << " moving registration " << *sb << dendl; + shared_blob_set.remove(sb); + dest->shared_blob_set.add(dest, sb); + } if (dest->cache != cache) { - if (sb->get_sbid()) { - ldout(store->cct, 20) << __func__ << " moving registration " << *sb << dendl; - shared_blob_set.remove(sb); - dest->shared_blob_set.add(dest, sb); - } for (auto& i : sb->bc.buffer_map) { if (!i.second->is_writing()) { ldout(store->cct, 20) << __func__ << " moving " << *i.second @@ -3253,8 +3254,6 @@ void BlueStore::Collection::split_cache( } } } - - } } } @@ -7792,7 +7791,7 @@ void BlueStore::_txc_write_nodes(TransContext *txc, KeyValueDB::Transaction t) bufferlist bl; ::encode(*(sb->persistent), bl); dout(20) << " shared_blob 0x" << std::hex << sbid << std::dec - << " is " << bl.length() << dendl; + << " is " << bl.length() << " " << *sb << dendl; t->set(PREFIX_SHARED_BLOB, key, bl); } }