diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2022-03-18 23:52:31 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-19 00:24:26 +0000 |
commit | c141ef8536d51f05a6fa4017de20286d154d09e1 (patch) | |
tree | 022bd1ffe70d91657498a2237ca8e49ed12de74b /src/mongo/db/s/session_catalog_migration_destination.cpp | |
parent | 6f2f79447a83f1cccb208d815e049699c8f86fbe (diff) | |
download | mongo-c141ef8536d51f05a6fa4017de20286d154d09e1.tar.gz |
SERVER-63494 Transfer history for retryable transactions with more than one oplog entry across migrations
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_destination.cpp')
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_destination.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp index 0b605ff92a0..afa092fe137 100644 --- a/src/mongo/db/s/session_catalog_migration_destination.cpp +++ b/src/mongo/db/s/session_catalog_migration_destination.cpp @@ -40,6 +40,7 @@ #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/logical_session_id.h" +#include "mongo/db/ops/write_ops_retryability.h" #include "mongo/db/repl/oplog.h" #include "mongo/db/repl/oplog_entry.h" #include "mongo/db/s/migration_session_id.h" @@ -216,6 +217,10 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON, // and o2 will be empty. // (3) Oplog entries that are a dead sentinel, which the donor sent over as the replacement // for a prepare oplog entry or unprepared transaction commit oplog entry. + // (4) Oplog entries that are a WouldChangeOwningShard sentinel entry, used for making + // retries of a WouldChangeOwningShard update or findAndModify fail with + // IncompleteTransactionHistory. In this case, the o field is non-empty and the o2 + // field is an empty BSONObj. BSONObj object2; if (oplogEntry.getObject2()) { @@ -224,7 +229,7 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON, oplogEntry.setObject2(object2); } - if (object2.isEmpty()) { + if (object2.isEmpty() && !isWouldChangeOwningShardSentinelOplogEntry(oplogEntry)) { result.isPrePostImage = true; uassert(40632, |