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

queryOnce should not call obtainMajorityCommittedSnapshot if it's a standalone node

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.3
    • Component/s: Sharding
    • Labels:
      None
    • ALL
    • Sharding 2018-04-09, Sharding 2018-06-04

      In SERVER-33609, setReadFromMajorityCommittedSnapshot() was refactored into two functions: setReadConcernLevelAndReplicationMode() and obtainMajorityCommittedSnapshot().

      setReadConcernLevelAndReplicationMode() should be called to set the readConcern level in the recovery unit. It should be called at the early stage of an operation.

      obtainMajorityCommittedSnapshot() is simply a function that refreshes the majorityCommittedSnapshot. It should only be called when we have "majority" or "snapshot" readConcern and replicationMode being modeReplSet.

      However, while running some sharding tests, in rs_local_client's queryOnce function, we could have readConcernLevel being "majority' while replicationMode being none (standalone node). I fixed those tests by manually setting the replicationMode to be replSet so we can call obtainMajorityCommittedSnapshot(). Another potential fix might be ignoring the standalone case? I am not sure what this function really wants here so I am creating this ticket for further fixes.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            xiangyu.yao@mongodb.com Xiangyu Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: