summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/SConscript1
-rw-r--r--src/mongo/db/commands/SConscript1
-rw-r--r--src/mongo/db/repl/SConscript1
-rw-r--r--src/mongo/db/repl/rollback_source.h6
-rw-r--r--src/mongo/db/repl/rollback_source_impl.cpp19
-rw-r--r--src/mongo/db/repl/rollback_source_impl.h3
-rw-r--r--src/mongo/db/repl/rollback_test_fixture.cpp3
-rw-r--r--src/mongo/db/repl/rollback_test_fixture.h2
-rw-r--r--src/mongo/db/repl/rs_rollback_test.cpp56
9 files changed, 0 insertions, 92 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index d6a5f50deb0..552183bea8f 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -373,7 +373,6 @@ mongod = env.Program(
'db/catalog/health_log',
'db/catalog/index_key_validate',
'db/client_metadata_propagation_egress_hook',
- 'db/cloner',
'db/collection_index_usage_tracker',
'db/commands/mongod',
'db/commands/mongod_fcv',
diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript
index b0fcd344704..fc737ef2bf0 100644
--- a/src/mongo/db/commands/SConscript
+++ b/src/mongo/db/commands/SConscript
@@ -422,7 +422,6 @@ env.Library(
'$BUILD_DIR/mongo/db/catalog/catalog_helpers',
'$BUILD_DIR/mongo/db/catalog/collection_catalog_helper',
'$BUILD_DIR/mongo/db/catalog/index_key_validate',
- '$BUILD_DIR/mongo/db/cloner',
'$BUILD_DIR/mongo/db/commands',
'$BUILD_DIR/mongo/db/curop_failpoint_helpers',
'$BUILD_DIR/mongo/db/dbhelpers',
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index b8316198382..297dbbab2a8 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -97,7 +97,6 @@ env.Library(
'repl_coordinator_interface',
'$BUILD_DIR/mongo/base',
'$BUILD_DIR/mongo/db/background',
- '$BUILD_DIR/mongo/db/cloner',
'$BUILD_DIR/mongo/db/concurrency/lock_manager',
'$BUILD_DIR/mongo/db/db_raii',
'$BUILD_DIR/mongo/db/dbhelpers',
diff --git a/src/mongo/db/repl/rollback_source.h b/src/mongo/db/repl/rollback_source.h
index 5d58240b820..6662bfc331b 100644
--- a/src/mongo/db/repl/rollback_source.h
+++ b/src/mongo/db/repl/rollback_source.h
@@ -90,12 +90,6 @@ public:
const BSONObj& filter) const = 0;
/**
- * Clones a single collection from the sync source.
- */
- virtual void copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const = 0;
-
- /**
* Finds and returns collection info using the UUID.
*/
virtual StatusWith<BSONObj> getCollectionInfoByUUID(const std::string& db,
diff --git a/src/mongo/db/repl/rollback_source_impl.cpp b/src/mongo/db/repl/rollback_source_impl.cpp
index bc111c75397..81edccee6ed 100644
--- a/src/mongo/db/repl/rollback_source_impl.cpp
+++ b/src/mongo/db/repl/rollback_source_impl.cpp
@@ -31,8 +31,6 @@
#include "mongo/db/repl/rollback_source_impl.h"
-#include "mongo/client/dbclient_connection.h"
-#include "mongo/db/cloner.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/repl/read_concern_args.h"
@@ -86,23 +84,6 @@ std::pair<BSONObj, NamespaceString> RollbackSourceImpl::findOneByUUID(const std:
return _getConnection()->findOneByUUID(db, uuid, filter, ReadConcernArgs::kImplicitDefault);
}
-void RollbackSourceImpl::copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const {
- std::string errmsg;
- auto tmpConn = std::make_unique<DBClientConnection>();
- uassert(15908, errmsg, tmpConn->connect(_source, StringData(), errmsg));
- uassertStatusOK(replAuthenticate(tmpConn.get()));
-
- // cloner owns _conn in unique_ptr
- Cloner cloner;
- cloner.setConnection(std::move(tmpConn));
- uassert(15909,
- str::stream() << "replSet rollback error resyncing collection " << nss.ns() << ' '
- << errmsg,
- cloner.copyCollection(
- opCtx, nss.ns(), BSONObj(), errmsg, true, CollectionOptions::parseForStorage));
-}
-
StatusWith<BSONObj> RollbackSourceImpl::getCollectionInfoByUUID(const std::string& db,
const UUID& uuid) const {
std::list<BSONObj> info = _getConnection()->getCollectionInfos(db, BSON("info.uuid" << uuid));
diff --git a/src/mongo/db/repl/rollback_source_impl.h b/src/mongo/db/repl/rollback_source_impl.h
index 66635dde23d..0c1e9fd643e 100644
--- a/src/mongo/db/repl/rollback_source_impl.h
+++ b/src/mongo/db/repl/rollback_source_impl.h
@@ -72,9 +72,6 @@ public:
UUID uuid,
const BSONObj& filter) const override;
- void copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const override;
-
StatusWith<BSONObj> getCollectionInfoByUUID(const std::string& db,
const UUID& uuid) const override;
diff --git a/src/mongo/db/repl/rollback_test_fixture.cpp b/src/mongo/db/repl/rollback_test_fixture.cpp
index aa5239c7560..4583e8232b6 100644
--- a/src/mongo/db/repl/rollback_test_fixture.cpp
+++ b/src/mongo/db/repl/rollback_test_fixture.cpp
@@ -289,9 +289,6 @@ std::pair<BSONObj, NamespaceString> RollbackSourceMock::findOneByUUID(const std:
return {BSONObj(), NamespaceString()};
}
-void RollbackSourceMock::copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const {}
-
StatusWith<BSONObj> RollbackSourceMock::getCollectionInfo(const NamespaceString& nss) const {
return BSON("name" << nss.ns() << "options" << BSONObj());
}
diff --git a/src/mongo/db/repl/rollback_test_fixture.h b/src/mongo/db/repl/rollback_test_fixture.h
index 294ee85409d..ae9d9c95b68 100644
--- a/src/mongo/db/repl/rollback_test_fixture.h
+++ b/src/mongo/db/repl/rollback_test_fixture.h
@@ -275,8 +275,6 @@ public:
UUID uuid,
const BSONObj& filter) const override;
- void copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const override;
StatusWith<BSONObj> getCollectionInfoByUUID(const std::string& db,
const UUID& uuid) const override;
StatusWith<BSONObj> getCollectionInfo(const NamespaceString& nss) const override;
diff --git a/src/mongo/db/repl/rs_rollback_test.cpp b/src/mongo/db/repl/rs_rollback_test.cpp
index 9d9d8976996..7ba48ce594d 100644
--- a/src/mongo/db/repl/rs_rollback_test.cpp
+++ b/src/mongo/db/repl/rs_rollback_test.cpp
@@ -1239,62 +1239,6 @@ TEST_F(RSRollbackTest, RollbackUnknownCommand) {
ASSERT_STRING_CONTAINS(status.reason(), "unable to determine common point");
}
-TEST_F(RSRollbackTest, RollbackDropCollectionCommand) {
- createOplog(_opCtx.get());
-
- OpTime dropTime = OpTime(Timestamp(2, 0), 5);
- auto dpns = NamespaceString("test.t").makeDropPendingNamespace(dropTime);
- CollectionOptions options;
- options.uuid = UUID::gen();
- auto coll = _createCollection(_opCtx.get(), dpns, options);
- _dropPendingCollectionReaper->addDropPendingNamespace(_opCtx.get(), dropTime, dpns);
-
- auto commonOperation = makeOpAndRecordId(1);
- auto dropCollectionOperation =
- std::make_pair(BSON("ts" << dropTime.getTimestamp() << "t" << dropTime.getTerm() << "op"
- << "c"
- << "ui" << coll->uuid() << "ns"
- << "test.t"
- << "wall" << Date_t() << "o"
- << BSON("drop"
- << "t")),
- RecordId(2));
- class RollbackSourceLocal : public RollbackSourceMock {
- public:
- RollbackSourceLocal(std::unique_ptr<OplogInterface> oplog)
- : RollbackSourceMock(std::move(oplog)), called(false) {}
- void copyCollectionFromRemote(OperationContext* opCtx,
- const NamespaceString& nss) const override {
- called = true;
- }
- mutable bool called;
- };
- RollbackSourceLocal rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({
- commonOperation,
- })));
-
- {
- AutoGetCollectionForReadCommand autoCollDropPending(_opCtx.get(), dpns);
- ASSERT_TRUE(autoCollDropPending.getCollection());
- AutoGetCollectionForReadCommand autoColl(_opCtx.get(), NamespaceString("test.t"));
- ASSERT_FALSE(autoColl.getCollection());
- }
- ASSERT_OK(syncRollback(_opCtx.get(),
- OplogInterfaceMock({dropCollectionOperation, commonOperation}),
- rollbackSource,
- {},
- {},
- _coordinator,
- _replicationProcess.get()));
- ASSERT_FALSE(rollbackSource.called);
- {
- AutoGetCollectionForReadCommand autoCollDropPending(_opCtx.get(), dpns);
- ASSERT_FALSE(autoCollDropPending.getCollection());
- AutoGetCollectionForReadCommand autoColl(_opCtx.get(), NamespaceString("test.t"));
- ASSERT_TRUE(autoColl.getCollection());
- }
-}
-
TEST_F(RSRollbackTest, RollbackRenameCollectionInSameDatabaseCommand) {
createOplog(_opCtx.get());
CollectionOptions options;