Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-97573

Investigate how preimages should handle missing documents

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

      If an update operation needs to record the preimage, but the document that it's supposed to update is missing, the node would log the constraint violation here and would crash the server if `oplogApplicationEnforcesSteadyStateConstraints` is true (but it is false by default). 

      But slightly after the logging the constraint violation, we check if the preimage is loaded if the update operation is not associated with `findAndModify` and crash the server if it isn't. Maybe we should make the invariants more consistent (for example, crashing the server if `oplogApplicationEnforcesSteadyStateConstraints` is true) or have some other way for preimages to handle when the document is missing. 

      Another invariant that we might want to consider modifying is when the operation needs to record the preimage and is also associated with findAndModify (here)

            Assignee:
            Unassigned Unassigned
            Reporter:
            evelyn.wu@mongodb.com Evelyn Wu
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: