diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2020-10-02 15:36:36 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-02 20:17:37 +0000 |
commit | 5726924e5c92e019a1730afb8b0724f0cb0e3473 (patch) | |
tree | a2279ee71a9296e57c46fa55da57914a9aa884d7 /src/mongo/db/repl | |
parent | ae595c7a7845271b88f6969dd2100435cdc760b7 (diff) | |
download | mongo-5726924e5c92e019a1730afb8b0724f0cb0e3473.tar.gz |
Revert "SERVER-48518 Fix rollback via refetch anomaly"
This reverts commit 09c14216c0f4adae7d12c27dc034ffbf4e9b7001.
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r-- | src/mongo/db/repl/rs_rollback.cpp | 14 | ||||
-rw-r--r-- | src/mongo/db/repl/rs_rollback.h | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 14 |
3 files changed, 0 insertions, 31 deletions
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index 812eb5ef81e..e95fcaf4044 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -892,7 +892,6 @@ Status _syncRollback(OperationContext* opCtx, FixUpInfo how; log() << "Starting rollback. Sync source: " << rollbackSource.getSource() << rsLog; - how.localTopOfOplog = replCoord->getMyLastAppliedOpTime(); how.rbid = rollbackSource.getRollbackId(); uassert( 40506, "Upstream node rolled back. Need to retry our rollback.", how.rbid == requiredRBID); @@ -1433,19 +1432,6 @@ void rollback_internal::syncFixUp(OperationContext* opCtx, log() << "Rollback deleted " << deletes << " documents and updated " << updates << " documents."; - // Rolling back via refetch, we set initialDataTimestamp to max(local oplog top, source's oplog - // top), then roll back. Data is inconsistent until lastApplied >= initialDataTimestamp. - auto syncSourceTopOfOplog = - OpTime::parseFromOplogEntry(rollbackSource.getLastOperation()).getValue().getTimestamp(); - - log() << "Setting initialDataTimestamp to the max of local top of oplog and sync source " - "top of oplog. Local top of oplog: " - << fixUpInfo.localTopOfOplog.getTimestamp() - << ", sync source top of oplog: " << syncSourceTopOfOplog; - - opCtx->getServiceContext()->getStorageEngine()->setInitialDataTimestamp( - std::max(fixUpInfo.localTopOfOplog.getTimestamp(), syncSourceTopOfOplog)); - log() << "Truncating the oplog at " << fixUpInfo.commonPoint.toString() << " (" << fixUpInfo.commonPointOurDiskloc << "), non-inclusive"; diff --git a/src/mongo/db/repl/rs_rollback.h b/src/mongo/db/repl/rs_rollback.h index f6c3ba4a729..3d8274421d0 100644 --- a/src/mongo/db/repl/rs_rollback.h +++ b/src/mongo/db/repl/rs_rollback.h @@ -286,9 +286,6 @@ struct FixUpInfo { // after rollback the in-memory transaction table is cleared. bool refetchTransactionDocs = false; - // The local node's top of oplog prior to entering rollback. - OpTime localTopOfOplog; - OpTime commonPoint; RecordId commonPointOurDiskloc; diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index c0d5d5285f2..7a9e4b46d57 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -812,20 +812,6 @@ void tryToGoLiveAsASecondary(OperationContext* opCtx, return; } - // Rolling back with eMRC false, we set initialDataTimestamp to max(local oplog top, source's - // oplog top), then rollback via refetch. Data is inconsistent until lastApplied >= - // initialDataTimestamp. - auto initialTs = opCtx->getServiceContext()->getStorageEngine()->getInitialDataTimestamp(); - if (lastApplied.getTimestamp() < initialTs) { - invariant(!serverGlobalParams.enableMajorityReadConcern); - LOG(2) << "We cannot transition to SECONDARY state because our 'lastApplied' optime is " - "less than the initial data timestamp and enableMajorityReadConcern = false. " - "minValid optime: " - << minValid << ", lastApplied optime: " << lastApplied - << ", initialDataTimestamp: " << initialTs; - return; - } - // Execute the transition to SECONDARY. auto status = replCoord->setFollowerMode(MemberState::RS_SECONDARY); if (!status.isOK()) { |