summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-10-07 01:56:44 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-08 02:27:55 +0000
commit55f7f003bf531656443a90b65c5d8f4f43058a60 (patch)
treeb3b18434550ce887579d44d844b929d40db1f602
parent74efd2d0caecd7bb9c59286f3136ae04c07908e4 (diff)
downloadmongo-55f7f003bf531656443a90b65c5d8f4f43058a60.tar.gz
SERVER-49754 Remove unused OperationContext from KVEngine::dropIdent()
-rw-r--r--src/mongo/db/storage/durable_catalog_impl.cpp12
-rw-r--r--src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.cpp2
-rw-r--r--src/mongo/db/storage/kv/kv_engine.h7
3 files changed, 8 insertions, 13 deletions
diff --git a/src/mongo/db/storage/durable_catalog_impl.cpp b/src/mongo/db/storage/durable_catalog_impl.cpp
index 7d28e888dd1..94688b8dee9 100644
--- a/src/mongo/db/storage/durable_catalog_impl.cpp
+++ b/src/mongo/db/storage/durable_catalog_impl.cpp
@@ -220,20 +220,16 @@ public:
class DurableCatalogImpl::AddIndexChange : public RecoveryUnit::Change {
public:
- AddIndexChange(OperationContext* opCtx,
- RecoveryUnit* ru,
- StorageEngineInterface* engine,
- StringData ident)
- : _opCtx(opCtx), _recoveryUnit(ru), _engine(engine), _ident(ident.toString()) {}
+ AddIndexChange(RecoveryUnit* ru, StorageEngineInterface* engine, StringData ident)
+ : _recoveryUnit(ru), _engine(engine), _ident(ident.toString()) {}
virtual void commit(boost::optional<Timestamp>) {}
virtual void rollback() {
// Intentionally ignoring failure.
auto kvEngine = _engine->getEngine();
- MONGO_COMPILER_VARIABLE_UNUSED auto status = kvEngine->dropIdent(_recoveryUnit, _ident);
+ kvEngine->dropIdent(_recoveryUnit, _ident).ignore();
}
- OperationContext* const _opCtx;
RecoveryUnit* const _recoveryUnit;
StorageEngineInterface* _engine;
const std::string _ident;
@@ -1138,7 +1134,7 @@ Status DurableCatalogImpl::prepareForIndexBuild(OperationContext* opCtx,
opCtx, getCollectionOptions(opCtx, catalogId), ident, spec, prefix);
if (status.isOK()) {
opCtx->recoveryUnit()->registerChange(
- std::make_unique<AddIndexChange>(opCtx, opCtx->recoveryUnit(), _engine, ident));
+ std::make_unique<AddIndexChange>(opCtx->recoveryUnit(), _engine, ident));
}
return status;
diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.cpp b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.cpp
index b5ecae6c0a3..93ff835fb2a 100644
--- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.cpp
+++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.cpp
@@ -172,7 +172,7 @@ Status KVEngine::dropIdent(mongo::RecoveryUnit* ru, StringData ident) {
lock.unlock();
if (isRecordStore) { // ident is RecordStore.
CollectionOptions s;
- auto rs = getRecordStore(nullptr, ""_sd, ident, s);
+ auto rs = getRecordStore(/*opCtx=*/nullptr, ""_sd, ident, s);
dropStatus =
checked_cast<RecordStore*>(rs.get())->truncateWithoutUpdatingCount(ru).getStatus();
} else { // ident is SortedDataInterface.
diff --git a/src/mongo/db/storage/kv/kv_engine.h b/src/mongo/db/storage/kv/kv_engine.h
index 5a4757ae847..7403f2e5da7 100644
--- a/src/mongo/db/storage/kv/kv_engine.h
+++ b/src/mongo/db/storage/kv/kv_engine.h
@@ -210,10 +210,9 @@ public:
virtual Status repairIdent(OperationContext* opCtx, StringData ident) = 0;
/**
- * Takes a RecoveryUnit. Obtaining the RecoveryUnit from the OperationContext is not
- * necessarily possible, since as of SERVER-44139 dropIdent can be called as part of
- * multi-document transactions, which use the same RecoveryUnit throughout but not the same
- * OperationContext.
+ * Removes any knowledge of the ident from the storage engines metadata which includes removing
+ * the underlying files belonging to the ident. If the storage engine is unable to process the
+ * removal immediately, we enqueue it to be removed at a later time.
*/
virtual Status dropIdent(RecoveryUnit* ru, StringData ident) = 0;