[SERVER-42746] Investigate if batch writer behaves correctly when we fail because we could not target for an unsharded collection Created: 09/Aug/19  Updated: 01/Oct/19  Resolved: 27/Sep/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Cheahuychou Mao
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Sharding 2019-10-07
Participants:

 Description   

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?

Generated at Thu Feb 08 05:01:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.