diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2021-05-25 18:45:32 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-25 19:49:25 +0000 |
commit | 3637dce904cc334f7e72dcf23516f18c7b815eda (patch) | |
tree | bdb615ffaa790f6cbfe6fe2f198974844282e253 /src | |
parent | 3c285730067966d090193a30642ca846a2a6f910 (diff) | |
download | mongo-3637dce904cc334f7e72dcf23516f18c7b815eda.tar.gz |
SERVER-57099: Preserve donor oplog optime in o2 when avoid re-wrapping previously migrated retryable writes noop
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/repl/tenant_oplog_applier.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repl/tenant_oplog_applier.cpp b/src/mongo/db/repl/tenant_oplog_applier.cpp index 70da52f7ee4..dd8b69ec271 100644 --- a/src/mongo/db/repl/tenant_oplog_applier.cpp +++ b/src/mongo/db/repl/tenant_oplog_applier.cpp @@ -663,6 +663,13 @@ void TenantOplogApplier::_writeSessionNoOpsForRange( opCtx->getServiceContext()->getFastClockSource()->now()); // Clear the old tenant migration UUID. noopEntry.setFromTenantMigration(boost::none); + + // Set the inner 'o2' optime to the donor entry's optime because the recipient + // uses the timestamp in 'o2' to determine where to resume applying from. + auto o2Entry = uassertStatusOK(MutableOplogEntry::parse(*entry.getObject2())); + o2Entry.setOpTime(entry.getOpTime()); + o2Entry.setWallClockTime(entry.getWallClockTime()); + noopEntry.setObject2(o2Entry.toBSON()); } } stmtIds.insert(stmtIds.end(), entryStmtIds.begin(), entryStmtIds.end()); |