diff options
author | Judah Schvimer <judah@mongodb.com> | 2017-11-29 14:28:53 -0500 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2017-11-30 15:29:38 -0500 |
commit | 764fb1bf8e3fec306652a8a707527dad8997084e (patch) | |
tree | 123063a04081cdda321700e770b07504c4d1c493 /src/mongo/db/repl/replication_process.cpp | |
parent | b3faf0eb6cdc8f169a6b8f59f83dd1e5eb4a62f7 (diff) | |
download | mongo-764fb1bf8e3fec306652a8a707527dad8997084e.tar.gz |
SERVER-32114 remove RollbackProgress
Diffstat (limited to 'src/mongo/db/repl/replication_process.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_process.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/mongo/db/repl/replication_process.cpp b/src/mongo/db/repl/replication_process.cpp index efeb1c08faf..34b11820682 100644 --- a/src/mongo/db/repl/replication_process.cpp +++ b/src/mongo/db/repl/replication_process.cpp @@ -54,15 +54,8 @@ const auto getReplicationProcess = ServiceContext::declareDecoration<std::unique_ptr<ReplicationProcess>>(); const auto kRollbackNamespacePrefix = "local.system.rollback."_sd; - -const auto kRollbackProgressIdDoc = BSON("_id" - << "rollbackProgress"); -const auto kRollbackProgressIdKey = kRollbackProgressIdDoc["_id"]; } // namespace -const NamespaceString ReplicationProcess::kRollbackProgressNamespace(kRollbackNamespacePrefix + - "progress"); - ReplicationProcess* ReplicationProcess::get(ServiceContext* service) { return getReplicationProcess(service).get(); } @@ -148,48 +141,6 @@ Status ReplicationProcess::incrementRollbackID(OperationContext* opCtx) { return status.getStatus(); } -StatusWith<OpTime> ReplicationProcess::getRollbackProgress(OperationContext* opCtx) { - auto documentResult = - _storageInterface->findById(opCtx, kRollbackProgressNamespace, kRollbackProgressIdKey); - if (!documentResult.isOK()) { - return documentResult.getStatus(); - } - const auto& doc = documentResult.getValue(); - RollbackProgress rollbackProgress; - try { - rollbackProgress = RollbackProgress::parse(IDLParserErrorContext("RollbackProgress"), doc); - } catch (...) { - return exceptionToStatus(); - } - return rollbackProgress.getApplyUntil(); -} - -Status ReplicationProcess::setRollbackProgress(OperationContext* opCtx, const OpTime& applyUntil) { - auto status = _storageInterface->createCollection(opCtx, kRollbackProgressNamespace, {}); - if (ErrorCodes::NamespaceExists == status.code()) { - // Collection exists. Proceed to upsert progress document. - } else if (!status.isOK()) { - return status; - } - RollbackProgress rollbackProgress; - rollbackProgress.set_id(kRollbackProgressIdKey.String()); - rollbackProgress.setApplyUntil(applyUntil); - BSONObjBuilder bob; - rollbackProgress.serialize(&bob); - return _storageInterface->upsertById( - opCtx, kRollbackProgressNamespace, kRollbackProgressIdKey, bob.obj()); -} - -Status ReplicationProcess::clearRollbackProgress(OperationContext* opCtx) { - auto status = _storageInterface->deleteByFilter(opCtx, kRollbackProgressNamespace, {}); - if (ErrorCodes::NamespaceNotFound == status) { - return Status::OK(); - } else if (!status.isOK()) { - return status; - } - return Status::OK(); -} - ReplicationConsistencyMarkers* ReplicationProcess::getConsistencyMarkers() { return _consistencyMarkers.get(); } |