From 491879a73d9a6304c9b3824193a3a29d09039b15 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Mon, 14 Nov 2016 18:33:31 -0500 Subject: SERVER-26716 Fix crash after 3.2.old->3.2.new->3.2.old up/downgrade This was only an issue for nodes that had never done writes as a secondary and therefore hadn't written a minValid point. (cherry picked from commit 39d650faa5436a37359ca45717d5e988fb4461cb) --- src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp index 67abc29502e..128e18b9f53 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp @@ -335,6 +335,10 @@ void ReplicationCoordinatorExternalStateImpl::cleanUpLastApplyBatch(OperationCon return; // Initial Sync will take over so no cleanup is needed. } + // This initializes the minvalid document with a null "ts" because older versions (<3.2.10) + // get angry if the minValid document is present but doesn't have a "ts" field. + setMinValidToAtLeast(txn, {}); + const auto deleteFromPoint = getOplogDeleteFromPoint(txn); const auto appliedThrough = getAppliedThrough(txn); -- cgit v1.2.1