]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix split_cache 51442/head
authorAdam Kupczyk <akupczyk@ibm.com>
Mon, 17 Jul 2023 07:31:05 +0000 (07:31 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 9 Aug 2023 07:51:58 +0000 (07:51 +0000)
Fix cache was broken as it moved blobs and extents between cache shards
without changing atomic num_blobs, num_extent counters.

Now tracking counters correctly.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 3e016c9352a1bfab43c9b5615ed7df7cdc836b17..a7ee1a280bb7cbabac7ab4eae81bf355fddeafbc 100644 (file)
@@ -5137,6 +5137,8 @@ void BlueStore::Collection::split_cache(
                                 << dendl;
          }
        }
+       cache->rm_blob();
+       dest->cache->add_blob();
        SharedBlob* sb = b->shared_blob.get();
        if (sb->coll == dest) {
          ldout(store->cct, 20) << __func__ << "  already moved " << *sb
@@ -5160,6 +5162,8 @@ void BlueStore::Collection::split_cache(
        b.second->last_encoded_id = -1;
       }
       for (auto& e : o->extent_map.extent_map) {
+       cache->rm_extent();
+       dest->cache->add_extent();
        Blob* tb = e.blob.get();
        if (tb->last_encoded_id == -1) {
          rehome_blob(tb);