From: Sage Weil Date: Tue, 20 Jun 2017 15:56:08 +0000 (-0400) Subject: os/bluestore: move sharedblob to new collection in same shard X-Git-Tag: v12.1.0~17^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3befb062c7acc53b21c64095737dea55c9dec5b1;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 2d34799662213..b4cf2735590da 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); } }