From: Igor Fedotov Date: Mon, 23 Aug 2021 15:03:41 +0000 (+0300) Subject: Merge pull request #42439 from ifed01/wip-ifed-more-errors-shared-blob-repair X-Git-Tag: v17.1.0~1043 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a49f10e760b48aaf476647ca394a1403706cc077;p=ceph.git Merge pull request #42439 from ifed01/wip-ifed-more-errors-shared-blob-repair os/bluestore: fix additional errors during missed shared blob repair. Reviewed-by: Adam Kupczyk --- a49f10e760b48aaf476647ca394a1403706cc077 diff --cc src/os/bluestore/BlueStore.cc index 926b61ed3b67,71b94cc96219..a819b80c4a19 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@@ -9083,8 -8959,28 +9106,25 @@@ void BlueStore::inject_broken_shared_bl db->submit_transaction_sync(txn); }; + void BlueStore::inject_no_shared_blob_key() + { + KeyValueDB::Transaction txn; + txn = db->get_transaction(); + ceph_assert(blobid_last > 0); + // kill the last used sbid, this can be broken due to blobid preallocation + // in rare cases, leaving as-is for the sake of simplicity + uint64_t sbid = blobid_last; + + string key; + dout(5) << __func__<< " " << sbid << dendl; + get_shared_blob_key(sbid, &key); + txn->rmkey(PREFIX_SHARED_BLOB, key); + db->submit_transaction_sync(txn); + }; + + void BlueStore::inject_leaked(uint64_t len) { - KeyValueDB::Transaction txn; - txn = db->get_transaction(); - PExtentVector exts; int64_t alloc_len = shared_alloc.a->allocate(len, min_alloc_size, min_alloc_size * 256, 0, &exts);