]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: move sharedblob to new collection in same shard 15783/head
authorSage Weil <sage@redhat.com>
Tue, 20 Jun 2017 15:56:08 +0000 (11:56 -0400)
committerSage Weil <sage@redhat.com>
Tue, 20 Jun 2017 15:56:08 +0000 (11:56 -0400)
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 <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 2d34799662213b2a4958b1b1508301a9edee5198..b4cf2735590dae12fca825a840bfbfd3b3f89e4b 100644 (file)
@@ -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);
     }
   }