[SERVER-31806] makeNoopWriter crashes when the last applied optime advances in the face of failed appendOplogNotes. Created: 02/Nov/17  Updated: 30/Oct/23  Resolved: 14/Nov/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.6.0-rc4, 3.7.1

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Misha Tyulenev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-31609 mongod hangs waiting for afterCluster... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-11-13, Sharding 2017-12-04
Participants:
Linked BF Score: 0

 Description   

I believe this is 3.6 required.

makeNoopWriteIfNeeded (in read_concern.cpp) will ensure an oplog document exists on the primary with at least the clusterTime. This guarantees the secondary will eventually apply up to the requested clusterTime.

This method can succeed in two(ish) cases.

  1. The method successfully sends a appendOplogNote to the primary with the requested cluster time. The caller can wait for this document to come down the pipe with confidence.
  2. While making requests that are not succeeding, the lastAppliedOpTime continues to advance. If it advances beyond the requested clusterTime, there's no need to make further requests.
  3. A generalization of the previous point, a request may never need to be made, and the method will immediately return.

The method initializes a return status of OK. Some error cases will immediately return an error code, such as not finding the correct shard, or the number of retries to make the request has been exceeded. Otherwise status is assigned the latest result of the request.

However, when a request fails, leaving status in an error state, the lastAppliedOpTime is refreshed. If this new value exceeds the requested clusterTime, the loop will exit, but the code invariants that the status is ok.



 Comments   
Comment by Githook User [ 14/Nov/17 ]

Author:

{'name': 'Misha Tyulenev', 'username': 'mikety', 'email': 'misha@mongodb.com'}

Message: SERVER-31806 do not invariant on the error status in makeNoopWriteIfNeeded

(cherry picked from commit f6d08a2e38cd27bd0e9a841a6ffc112ce0298d0f)
Branch: v3.6
https://github.com/mongodb/mongo/commit/876bb9586ce66ecb8938f679222cf638e7e22b8c

Comment by Githook User [ 14/Nov/17 ]

Author:

{'name': 'Misha Tyulenev', 'username': 'mikety', 'email': 'misha@mongodb.com'}

Message: SERVER-31806 do not invariant on the error status in makeNoopWriteIfNeeded
Branch: master
https://github.com/mongodb/mongo/commit/f6d08a2e38cd27bd0e9a841a6ffc112ce0298d0f

Generated at Thu Feb 08 04:28:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.