File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -523,9 +523,11 @@ OpTime SyncTail::multiApply(OperationContext* txn, const OpQueue& ops) {
523523 raws.emplace_back (op.raw );
524524 }
525525 lastOpTime = writeOpsToOplog (txn, raws);
526- if (inShutdown ()) {
527- return OpTime ();
528- }
526+ }
527+
528+ if (inShutdownStrict ()) {
529+ log () << " Cannot apply operations due to shutdown in progress" ;
530+ return OpTime ();
529531 }
530532 // We have now written all database writes and updated the oplog to match.
531533 return lastOpTime;
@@ -743,8 +745,16 @@ void SyncTail::oplogApplication() {
743745 setMinValid (&txn, {start, end});
744746
745747 lastWriteOpTime = multiApply (&txn, ops);
746- setNewTimestamp (lastWriteOpTime.getTimestamp ());
748+ if (lastWriteOpTime.isNull ()) {
749+ // fassert if oplog application failed for any reasons other than shutdown.
750+ error () << " Failed to apply " << ops.getDeque ().size ()
751+ << " operations - batch start:" << start << " end:" << end;
752+ fassert (34360 , inShutdownStrict ());
753+ // Return without setting minvalid in the case of shutdown.
754+ return ;
755+ }
747756
757+ setNewTimestamp (lastWriteOpTime.getTimestamp ());
748758 setMinValid (&txn, end, DurableRequirement::None);
749759 minValidBoundaries.start = {};
750760 minValidBoundaries.end = end;
You can’t perform that action at this time.
0 commit comments