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

Investigate if batch writer behaves correctly when we fail because we could not target for an unsharded collection

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Sharding 2019-10-07

      It is possible that mongos was not able to target a write batch on a collection that mongos's cache says is unsharded. Such an error should only come from this block, since the other place an error can come from should only occur if mongos targeted more than one shard. At first glance, it seems that the only error targetInsert, targetUpdate, and targetDelete (through _targetQuery) can return if mongos's cache says the collection is unsharded is NamespaceNotFound. If that is returned, the targeter's _needsTargetingRefresh will be set to true. Then when targeter.refreshIfNeeded is called, it will take this branch. I want to know:

      1. Is NamespaceNotFound really the only error expected when targeting an unsharded collection?
      2. If so, does that branch handle NamespaceNotFound in a sane way?
      3. If not, should that branch be calling _refreshDbVersionNow?

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: