diff options
author | Judah Schvimer <judah@mongodb.com> | 2017-06-29 11:42:14 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2017-06-29 11:42:14 -0400 |
commit | 103256372fc4f4cec1c736482c1ed520ee0de290 (patch) | |
tree | b71097acc400be7df5ab94ec7104d07d752852cb /src/mongo/db/repl/rs_rollback_test.cpp | |
parent | 560b3f562832664c1cb09cdbf3a257493bad6ba8 (diff) | |
download | mongo-103256372fc4f4cec1c736482c1ed520ee0de290.tar.gz |
SERVER-29276 rolls back drop pending collections
Diffstat (limited to 'src/mongo/db/repl/rs_rollback_test.cpp')
-rw-r--r-- | src/mongo/db/repl/rs_rollback_test.cpp | 274 |
1 files changed, 210 insertions, 64 deletions
diff --git a/src/mongo/db/repl/rs_rollback_test.cpp b/src/mongo/db/repl/rs_rollback_test.cpp index c848ebfa00a..6b0ba57b556 100644 --- a/src/mongo/db/repl/rs_rollback_test.cpp +++ b/src/mongo/db/repl/rs_rollback_test.cpp @@ -44,6 +44,7 @@ #include "mongo/db/index/index_descriptor.h" #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" +#include "mongo/db/repl/drop_pending_collection_reaper.h" #include "mongo/db/repl/oplog.h" #include "mongo/db/repl/oplog_interface.h" #include "mongo/db/repl/oplog_interface_mock.h" @@ -122,6 +123,7 @@ private: void RSRollbackTest::setUp() { RollbackTest::setUp(); + enableCollectionUUIDs = true; } void RSRollbackTest::tearDown() { @@ -273,12 +275,15 @@ Collection* _createCollection(OperationContext* opCtx, int _testRollbackDelete(OperationContext* opCtx, ReplicationCoordinator* coordinator, ReplicationProcess* replicationProcess, + UUID uuid, const BSONObj& documentAtSource) { auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); auto deleteOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "d" + << "ui" + << uuid << "ns" << "test.t" << "o" @@ -325,33 +330,43 @@ int _testRollbackDelete(OperationContext* opCtx, TEST_F(RSRollbackTest, RollbackDeleteNoDocumentAtSourceCollectionDoesNotExist) { createOplog(_opCtx.get()); ASSERT_EQUALS( - -1, _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), BSONObj())); + -1, + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), UUID::gen(), BSONObj())); } TEST_F(RSRollbackTest, RollbackDeleteNoDocumentAtSourceCollectionExistsNonCapped) { createOplog(_opCtx.get()); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); - _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), BSONObj()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), coll->uuid().get(), BSONObj()); ASSERT_EQUALS( - 0, _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), BSONObj())); + 0, + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), coll->uuid().get(), BSONObj())); } TEST_F(RSRollbackTest, RollbackDeleteNoDocumentAtSourceCollectionExistsCapped) { createOplog(_opCtx.get()); CollectionOptions options; options.capped = true; - _createCollection(_opCtx.get(), "test.t", options); + auto coll = _createCollection(_opCtx.get(), "test.t", options); ASSERT_EQUALS( - 0, _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), BSONObj())); + 0, + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), coll->uuid().get(), BSONObj())); } TEST_F(RSRollbackTest, RollbackDeleteRestoreDocument) { createOplog(_opCtx.get()); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); BSONObj doc = BSON("_id" << 0 << "a" << 1); - _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), doc); - ASSERT_EQUALS(1, - _testRollbackDelete(_opCtx.get(), _coordinator, _replicationProcess.get(), doc)); + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), coll->uuid().get(), doc); + ASSERT_EQUALS( + 1, + _testRollbackDelete( + _opCtx.get(), _coordinator, _replicationProcess.get(), coll->uuid().get(), doc)); } TEST_F(RSRollbackTest, RollbackInsertDocumentWithNoId) { @@ -361,6 +376,8 @@ TEST_F(RSRollbackTest, RollbackInsertDocumentWithNoId) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.t" << "o" @@ -423,6 +440,8 @@ TEST_F(RSRollbackTest, RollbackCreateIndexCommand) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.system.indexes" << "o" @@ -486,6 +505,8 @@ TEST_F(RSRollbackTest, RollbackCreateIndexCommandIndexNotInCatalog) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.system.indexes" << "o" @@ -533,6 +554,8 @@ TEST_F(RSRollbackTest, RollbackCreateIndexCommandMissingNamespace) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.system.indexes" << "o" @@ -593,6 +616,8 @@ TEST_F(RSRollbackTest, RollbackDropIndexCommandWithOneIndex) { auto dropIndexOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << collection->uuid().get() << "ns" << "test.$cmd" << "o" @@ -659,6 +684,8 @@ TEST_F(RSRollbackTest, RollbackDropIndexCommandWithMultipleIndexes) { auto dropIndexOperation1 = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << collection->uuid().get() << "ns" << "test.$cmd" << "o" @@ -672,6 +699,8 @@ TEST_F(RSRollbackTest, RollbackDropIndexCommandWithMultipleIndexes) { auto dropIndexOperation2 = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << collection->uuid().get() << "ns" << "test.$cmd" << "o" @@ -715,6 +744,8 @@ TEST_F(RSRollbackTest, RollbackCreateIndexCommandInvalidNamespace) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.system.indexes" << "o" @@ -763,6 +794,8 @@ TEST_F(RSRollbackTest, RollbackCreateIndexCommandMissingIndexName) { auto insertDocumentOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "i" + << "ui" + << UUID::gen() << "ns" << "test.system.indexes" << "o" @@ -808,20 +841,15 @@ TEST_F(RSRollbackTest, RollbackUnknownCommand) { auto unknownCommandOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << UUID::gen() << "ns" << "test.t" << "o" << BSON("convertToCapped" << "t")), RecordId(2)); - { - Lock::DBLock dbLock(_opCtx.get(), "test", MODE_X); - mongo::WriteUnitOfWork wuow(_opCtx.get()); - auto db = dbHolder().openDb(_opCtx.get(), "test"); - ASSERT_TRUE(db); - ASSERT_TRUE(db->getOrCreateCollection(_opCtx.get(), NamespaceString("test.t"))); - wuow.commit(); - } + auto status = syncRollback(_opCtx.get(), OplogInterfaceMock({unknownCommandOperation, commonOperation}), @@ -837,17 +865,26 @@ TEST_F(RSRollbackTest, RollbackUnknownCommand) { TEST_F(RSRollbackTest, RollbackDropCollectionCommand) { createOplog(_opCtx.get()); + + OpTime dropTime = OpTime(Timestamp(2, 0), 5); + auto dpns = NamespaceString("test.t").makeDropPendingNamespace(dropTime); + auto coll = _createCollection(_opCtx.get(), dpns, CollectionOptions()); + _dropPendingCollectionReaper->addDropPendingNamespace(dropTime, dpns); + auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); auto dropCollectionOperation = - std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" - << "c" - << "ns" - << "test.t" - << "o" - << BSON("drop" - << "t")), - RecordId(2)); + std::make_pair( + BSON("ts" << dropTime.getTimestamp() << "t" << dropTime.getTerm() << "h" << 1LL << "op" + << "c" + << "ui" + << coll->uuid().get() + << "ns" + << "test.t" + << "o" + << BSON("drop" + << "t")), + RecordId(2)); class RollbackSourceLocal : public RollbackSourceMock { public: RollbackSourceLocal(std::unique_ptr<OplogInterface> oplog) @@ -861,48 +898,65 @@ TEST_F(RSRollbackTest, RollbackDropCollectionCommand) { RollbackSourceLocal rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({ commonOperation, }))); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + + { + 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_TRUE(rollbackSource.called); + 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, RollbackDropCollectionCommandFailsIfRBIDChangesWhileSyncingCollection) { +TEST_F(RSRollbackTest, RollbackCollModCommandFailsIfRBIDChangesWhileSyncingCollectionMetadata) { createOplog(_opCtx.get()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); - auto dropCollectionOperation = + auto collModOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << coll->uuid().get() << "ns" << "test.t" << "o" - << BSON("drop" - << "t")), + << BSON("collMod" + << "t" + << "validationLevel" + << "off")), RecordId(2)); class RollbackSourceLocal : public RollbackSourceMock { public: using RollbackSourceMock::RollbackSourceMock; int getRollbackId() const override { - return copyCollectionCalled ? 1 : 0; + return getCollectionInfoCalled ? 1 : 0; } - void copyCollectionFromRemote(OperationContext* opCtx, - const NamespaceString& nss) const override { - copyCollectionCalled = true; + StatusWith<BSONObj> getCollectionInfo(const NamespaceString& nss) const override { + getCollectionInfoCalled = true; + return BSONObj(); } - mutable bool copyCollectionCalled = false; + mutable bool getCollectionInfoCalled = false; }; RollbackSourceLocal rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({ commonOperation, }))); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); ASSERT_THROWS_CODE(syncRollback(_opCtx.get(), - OplogInterfaceMock({dropCollectionOperation, commonOperation}), + OplogInterfaceMock({collModOperation, commonOperation}), rollbackSource, 0, _coordinator, @@ -910,7 +964,7 @@ TEST_F(RSRollbackTest, RollbackDropCollectionCommandFailsIfRBIDChangesWhileSynci .transitional_ignore(), DBException, 40508); - ASSERT(rollbackSource.copyCollectionCalled); + ASSERT(rollbackSource.getCollectionInfoCalled); } TEST_F(RSRollbackTest, RollbackDropDatabaseCommand) { @@ -920,6 +974,8 @@ TEST_F(RSRollbackTest, RollbackDropDatabaseCommand) { auto dropDatabaseOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << UUID::gen() << "ns" << "test.$cmd" << "o" @@ -936,11 +992,11 @@ TEST_F(RSRollbackTest, RollbackDropDatabaseCommand) { _replicationProcess.get())); } -BSONObj makeApplyOpsOplogEntry(Timestamp ts, std::initializer_list<BSONObj> ops) { +BSONObj makeApplyOpsOplogEntry(Timestamp ts, UUID uuid, std::initializer_list<BSONObj> ops) { BSONObjBuilder entry; entry << "ts" << ts << "h" << 1LL << "op" << "c" - << "ns" + << "ui" << uuid << "ns" << "admin"; { BSONObjBuilder cmd(entry.subobjStart("o")); @@ -968,11 +1024,11 @@ OpTime getOpTimeFromOplogEntry(const BSONObj& entry) { TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { createOplog(_opCtx.get()); - + Collection* coll = nullptr; { AutoGetOrCreateDb autoDb(_opCtx.get(), "test", MODE_X); mongo::WriteUnitOfWork wuow(_opCtx.get()); - auto coll = autoDb.getDb()->getCollection(_opCtx.get(), "test.t"); + coll = autoDb.getDb()->getCollection(_opCtx.get(), "test.t"); if (!coll) { coll = autoDb.getDb()->createCollection(_opCtx.get(), "test.t"); } @@ -985,12 +1041,16 @@ TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { ASSERT_OK(coll->insertDocument(_opCtx.get(), BSON("_id" << 4), nullOpDebug, false)); wuow.commit(); } + UUID uuid = coll->uuid().get(); const auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); const auto applyOpsOperation = std::make_pair(makeApplyOpsOplogEntry(Timestamp(Seconds(2), 0), + uuid, {BSON("op" << "u" + << "ui" + << uuid << "ts" << Timestamp(1, 1) << "t" @@ -1005,6 +1065,8 @@ TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { << BSON("_id" << 1 << "v" << 2)), BSON("op" << "u" + << "ui" + << uuid << "ts" << Timestamp(2, 1) << "t" @@ -1019,6 +1081,8 @@ TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { << BSON("_id" << 2 << "v" << 4)), BSON("op" << "d" + << "ui" + << uuid << "ts" << Timestamp(3, 1) << "t" @@ -1031,6 +1095,8 @@ TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { << BSON("_id" << 3)), BSON("op" << "i" + << "ui" + << uuid << "ts" << Timestamp(4, 1) << "t" @@ -1100,11 +1166,15 @@ TEST_F(RSRollbackTest, RollbackApplyOpsCommand) { TEST_F(RSRollbackTest, RollbackCreateCollectionCommand) { createOplog(_opCtx.get()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); auto createCollectionOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << coll->uuid().get() << "ns" << "test.t" << "o" @@ -1114,7 +1184,6 @@ TEST_F(RSRollbackTest, RollbackCreateCollectionCommand) { RollbackSourceMock rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({ commonOperation, }))); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); ASSERT_OK(syncRollback(_opCtx.get(), OplogInterfaceMock({createCollectionOperation, commonOperation}), rollbackSource, @@ -1131,11 +1200,15 @@ TEST_F(RSRollbackTest, RollbackCreateCollectionCommand) { TEST_F(RSRollbackTest, RollbackCollectionModificationCommand) { createOplog(_opCtx.get()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); auto collectionModificationOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << coll->uuid().get() << "ns" << "test.t" << "o" @@ -1157,7 +1230,6 @@ TEST_F(RSRollbackTest, RollbackCollectionModificationCommand) { RollbackSourceLocal rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({ commonOperation, }))); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); startCapturingLogMessages(); ASSERT_OK(syncRollback(_opCtx.get(), OplogInterfaceMock({collectionModificationOperation, commonOperation}), @@ -1175,11 +1247,15 @@ TEST_F(RSRollbackTest, RollbackCollectionModificationCommand) { TEST_F(RSRollbackTest, RollbackCollectionModificationCommandInvalidCollectionOptions) { createOplog(_opCtx.get()); + auto coll = _createCollection(_opCtx.get(), "test.t", CollectionOptions()); + auto commonOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(1), 0) << "h" << 1LL), RecordId(1)); auto collectionModificationOperation = std::make_pair(BSON("ts" << Timestamp(Seconds(2), 0) << "h" << 1LL << "op" << "c" + << "ui" + << coll->uuid().get() << "ns" << "test.t" << "o" @@ -1199,7 +1275,6 @@ TEST_F(RSRollbackTest, RollbackCollectionModificationCommandInvalidCollectionOpt RollbackSourceLocal rollbackSource(std::unique_ptr<OplogInterface>(new OplogInterfaceMock({ commonOperation, }))); - _createCollection(_opCtx.get(), "test.t", CollectionOptions()); auto status = syncRollback(_opCtx.get(), OplogInterfaceMock({collectionModificationOperation, commonOperation}), @@ -1212,39 +1287,110 @@ TEST_F(RSRollbackTest, RollbackCollectionModificationCommandInvalidCollectionOpt } TEST(RSRollbackTest, LocalEntryWithoutNsIsFatal) { - const auto validOplogEntry = fromjson( - "{op: 'i', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1), ns: 'test.t', o: " - "{_id:1, a: 1}}"); + const auto validOplogEntry = BSON("op" + << "i" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "test.t" + << "o" + << BSON("_id" << 1 << "a" << 1)); FixUpInfo fui; ASSERT_OK(updateFixUpInfoFromLocalOplogEntry(fui, validOplogEntry)); - const auto invalidOplogEntry = fromjson( - "{op: 'i', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1), ns: '', o: {_id:1, a: " - "1}}"); + const auto invalidOplogEntry = BSON("op" + << "i" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "" + << "o" + << BSON("_id" << 1 << "a" << 1)); ASSERT_THROWS(updateFixUpInfoFromLocalOplogEntry(fui, invalidOplogEntry).transitional_ignore(), RSFatalException); } TEST(RSRollbackTest, LocalEntryWithoutOIsFatal) { - const auto validOplogEntry = fromjson( - "{op: 'i', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1), ns: 'test.t', o: " - "{_id:1, a: 1}}"); + const auto validOplogEntry = BSON("op" + << "i" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "test.t" + << "o" + << BSON("_id" << 1 << "a" << 1)); FixUpInfo fui; ASSERT_OK(updateFixUpInfoFromLocalOplogEntry(fui, validOplogEntry)); - const auto invalidOplogEntry = fromjson( - "{op: 'i', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1), ns: 'test.t', o: {}}"); + const auto invalidOplogEntry = BSON("op" + << "i" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "test.t" + << "o" + << BSONObj()); ASSERT_THROWS(updateFixUpInfoFromLocalOplogEntry(fui, invalidOplogEntry).transitional_ignore(), RSFatalException); } TEST(RSRollbackTest, LocalEntryWithoutO2IsFatal) { - const auto validOplogEntry = fromjson( - "{op: 'u', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1),ns: 'test.t', o2: {_id: " - "1}, o: {_id:1, a: 1}}"); + const auto validOplogEntry = BSON("op" + << "u" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "test.t" + << "o" + << BSON("_id" << 1 << "a" << 1) + << "o2" + << BSON("_id" << 1)); FixUpInfo fui; ASSERT_OK(updateFixUpInfoFromLocalOplogEntry(fui, validOplogEntry)); - const auto invalidOplogEntry = fromjson( - "{op: 'u', ts: Timestamp(1,1), t: NumberLong(1), h: NumberLong(1),ns: 'test.t', o2: {}, " - "o: {_id:1, a: 1}}"); + const auto invalidOplogEntry = BSON("op" + << "u" + << "ui" + << UUID::gen() + << "ts" + << Timestamp(1, 1) + << "t" + << 1LL + << "h" + << 1LL + << "ns" + << "test.t" + << "o" + << BSON("_id" << 1 << "a" << 1) + << "o2" + << BSONObj()); ASSERT_THROWS(updateFixUpInfoFromLocalOplogEntry(fui, invalidOplogEntry).transitional_ignore(), RSFatalException); } |