Change oplog fetching query to read beyond lastApplied

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In SERVER-84195, we changed sync source selection to use lastWritten instead of lastApplied. However, when we do oplog fetching , we use a local read against the sync source, which will be transformed to a PIT read at lastApplied if the sync source is a secondary. This can cause a problem in the following case(T1 < T2 < T3):

      • Node A is a secondary and lastWritten(A)=T3, lastApplied(A)=T1
      • Node B is another secondary and lastWritten(B)=T2
      • Node B changes its sync source to be A because A's lastWritten is greater than B's.
      • Node B sends a find cmd to Node A but Node A turns that into a snapshot read at T1, which will give Node B nothing. 
      • Node B goes into an unexpected rollback.

              Assignee:
              Unassigned
              Reporter:
              Jiawei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: