diff options
Diffstat (limited to 'src/mongo/db/repl/rs_rollback.cpp')
-rw-r--r-- | src/mongo/db/repl/rs_rollback.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index bb5531dbf34..0663c13e4dd 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -37,17 +37,17 @@ #include <memory> #include "mongo/bson/util/bson_extract.h" -#include "mongo/db/auth/authorization_manager_global.h" #include "mongo/db/auth/authorization_manager.h" +#include "mongo/db/auth/authorization_manager_global.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/document_validation.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/concurrency/write_conflict_exception.h" +#include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" #include "mongo/db/exec/working_set_common.h" -#include "mongo/db/db_raii.h" #include "mongo/db/ops/delete.h" #include "mongo/db/ops/update.h" #include "mongo/db/ops/update_lifecycle_impl.h" @@ -454,7 +454,8 @@ void syncFixUp(OperationContext* txn, auto status = options.parse(optionsField.Obj()); if (!status.isOK()) { throw RSFatalException(str::stream() << "Failed to parse options " << info - << ": " << status.toString()); + << ": " + << status.toString()); } } else { // Use default options. @@ -467,19 +468,19 @@ void syncFixUp(OperationContext* txn, auto status = collection->setValidator(txn, options.validator); if (!status.isOK()) { - throw RSFatalException(str::stream() - << "Failed to set validator: " << status.toString()); + throw RSFatalException(str::stream() << "Failed to set validator: " + << status.toString()); } status = collection->setValidationAction(txn, options.validationAction); if (!status.isOK()) { - throw RSFatalException(str::stream() - << "Failed to set validationAction: " << status.toString()); + throw RSFatalException(str::stream() << "Failed to set validationAction: " + << status.toString()); } status = collection->setValidationLevel(txn, options.validationLevel); if (!status.isOK()) { - throw RSFatalException(str::stream() - << "Failed to set validationLevel: " << status.toString()); + throw RSFatalException(str::stream() << "Failed to set validationLevel: " + << status.toString()); } wuow.commit(); @@ -822,7 +823,8 @@ Status _syncRollback(OperationContext* txn, if (!replCoord->setFollowerMode(MemberState::RS_ROLLBACK)) { return Status(ErrorCodes::OperationFailed, str::stream() << "Cannot transition from " - << replCoord->getMemberState().toString() << " to " + << replCoord->getMemberState().toString() + << " to " << MemberState(MemberState::RS_ROLLBACK).toString()); } } @@ -833,8 +835,9 @@ Status _syncRollback(OperationContext* txn, { log() << "rollback 2 FindCommonPoint"; try { - auto processOperationForFixUp = - [&how](const BSONObj& operation) { return refetch(how, operation); }; + auto processOperationForFixUp = [&how](const BSONObj& operation) { + return refetch(how, operation); + }; auto res = syncRollBackLocalOperations( localOplog, rollbackSource.getOplog(), processOperationForFixUp); if (!res.isOK()) { @@ -856,7 +859,8 @@ Status _syncRollback(OperationContext* txn, return Status(ErrorCodes::UnrecoverableRollbackError, str::stream() << "need to rollback, but unable to determine common point between" - " local and remote oplog: " << e.what(), + " local and remote oplog: " + << e.what(), 18752); } catch (const DBException& e) { warning() << "rollback 2 exception " << e.toString() << "; sleeping 1 min"; @@ -912,11 +916,9 @@ Status syncRollback(OperationContext* txn, const OplogInterface& localOplog, const RollbackSource& rollbackSource, ReplicationCoordinator* replCoord) { - return syncRollback(txn, - localOplog, - rollbackSource, - replCoord, - [](Seconds seconds) { sleepsecs(durationCount<Seconds>(seconds)); }); + return syncRollback(txn, localOplog, rollbackSource, replCoord, [](Seconds seconds) { + sleepsecs(durationCount<Seconds>(seconds)); + }); } } // namespace repl |