summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/resharding
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2022-12-01 20:24:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-03 19:43:42 +0000
commitbd227ce5529b0423ca791aa926db48ec8b10c07d (patch)
treed515feb5d4f487285ac3e8ef170393dd47a44356 /src/mongo/db/s/resharding
parent55e4a05daabba24a6ec976a69335823384ed981b (diff)
downloadmongo-bd227ce5529b0423ca791aa926db48ec8b10c07d.tar.gz
SERVER-71219 Migration can miss writes from prepared transactions
This commit does 2 things: 1. Make sure that we register the migration source op observer hook in all paths where transactions transitions into prepare. 2. If we don't have the post image doc, fetch the latest doc from storage. (cherry picked from commit 2f708612dc39780410bf40d31a404cb121f653a9)
Diffstat (limited to 'src/mongo/db/s/resharding')
-rw-r--r--src/mongo/db/s/resharding/resharding_op_observer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/s/resharding/resharding_op_observer.h b/src/mongo/db/s/resharding/resharding_op_observer.h
index 30d319a041d..e8affe3ef4a 100644
--- a/src/mongo/db/s/resharding/resharding_op_observer.h
+++ b/src/mongo/db/s/resharding/resharding_op_observer.h
@@ -228,6 +228,10 @@ public:
size_t numberOfPrePostImagesToWrite,
Date_t wallClockTime) override {}
+ void onTransactionPrepareNonPrimary(OperationContext* opCtx,
+ const std::vector<repl::OplogEntry>& statements,
+ const repl::OpTime& prepareOpTime) override {}
+
void onTransactionAbort(OperationContext* opCtx,
boost::optional<OplogSlot> abortOplogEntryOpTime) override {}