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

Reduce code duplication for StaleConfig handling within update and delete related PlanStages

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding, Write Ops
    • None
    • Catalog and Routing
    • 1

      PlanStages which do writes, such as UpdateStage, have special handling when

      1. documents are unowned and writes to them must be skipped,
      2. the update was broadcasted to multiple shards and must not be retried by mongos, and
      3. the update was targeted to a single shard and must not be retried by mongos.

      All three of these cases exist in DeleteStage and TimeseriesModifyStage. The first two cases exist in BatchedDeleteStage. The third case had been initially forgotten from TimeseriesModifyStage and was only added later (SERVER-79408). The risk of a similar mistake like this being made again in the future is too high and the risk of violating the sharding metadata contracts are too severe. We should devote real engineering time to refactor how writes are executed within the query machinery to unify the implementations and to more confidently test the behavior.

            Assignee:
            Unassigned Unassigned
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: