diff options
author | Benety Goh <benety@mongodb.com> | 2017-09-06 13:16:29 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-09-06 13:17:49 -0400 |
commit | 456ba544978a0d41a2261bf65da686874fb631a2 (patch) | |
tree | 40e06df83c3ceefb96912f889cc94c915ac1c9b9 /src/mongo/db/repl/rs_rollback.cpp | |
parent | e3f3b1357bb2838140f6e9a42ff704237d68afbe (diff) | |
download | mongo-456ba544978a0d41a2261bf65da686874fb631a2.tar.gz |
SERVER-30381 Remove handing for rolling back dropSource collections
Diffstat (limited to 'src/mongo/db/repl/rs_rollback.cpp')
-rw-r--r-- | src/mongo/db/repl/rs_rollback.cpp | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index 7f7eb82bb06..8795ec17db5 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -185,35 +185,6 @@ Status FixUpInfo::recordDropTargetInfo(const BSONElement& dropTarget, return Status::OK(); } -Status FixUpInfo::recordCrossDatabaseRenameRollbackInfo(const BSONElement& dropSource, - const BSONObj& obj, - const NamespaceString& nss, - UUID uuid, - OpTime opTime) { - - StatusWith<UUID> uuidWithStatus = UUID::parse(dropSource); - if (!uuidWithStatus.isOK()) { - std::string message = str::stream() - << "Unable to roll back cross database renameCollection. Cannot parse " - << "dropSource UUID. Returned status: " << redact(uuidWithStatus.getStatus()) - << ", oplog entry: " << redact(obj); - error() << message; - return uuidWithStatus.getStatus(); - } - UUID dropSourceUUID = uuidWithStatus.getValue(); - - // If a cross-database rename has occurred, we record it as separate - // createCollection and dropCollection commands. First, we record the - // necessary information for the source collection to be un-dropped. - recordRollingBackDrop(nss, opTime, dropSourceUUID); - - // Next, we need to drop the new collection that was created due to the rename. - // Dropping this collection will effectively drop all the documents inserted into - // the collection, rolling back the copy portion of the renameCollection command. - collectionsToDrop.insert(uuid); - return Status::OK(); -} - Status rollback_internal::updateFixUpInfoFromLocalOplogEntry(FixUpInfo& fixUpInfo, const BSONObj& ourObj) { @@ -399,13 +370,10 @@ Status rollback_internal::updateFixUpInfoFromLocalOplogEntry(FixUpInfo& fixUpInf // to: "foo.y", // stayTemp: false, // dropTarget: BinData(...), - // dropSource: BinData(...), // } // dropTarget will be false if no collection is dropped during the rename. - // dropSource is only present during a cross-database rename, and contains - // the UUID of the collection that is being renamed over. The ui field will - // contain the UUID of the new collection that is created. + // The ui field will contain the UUID of the new collection that is created. BSONObj cmd = obj; @@ -429,16 +397,6 @@ Status rollback_internal::updateFixUpInfoFromLocalOplogEntry(FixUpInfo& fixUpInf } } - // Checks if the renameCollection is a cross-database rename. If the dropSource - // field is present in the oplog entry then the renameCollection must be a - // cross-database rename. The field will be absent in renames in the same - // database. - auto dropSource = obj.getField("dropSource"); - if (!dropSource.eoo()) { - return fixUpInfo.recordCrossDatabaseRenameRollbackInfo( - dropSource, obj, NamespaceString(ns), *uuid, oplogEntry.getOpTime()); - } - RenameCollectionInfo info; info.renameTo = NamespaceString(ns); info.renameFrom = NamespaceString(obj.getStringField("to")); |