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

Make index_commands_shard_targeting.js not assert that index commands run during critical section fail with MaxTimeMSExpired

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc0, 4.7.0
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Sharding 2020-04-06
    • 14

      There is no guarantee that the command will always fail with MaxTimeMSExpired because of a race in the AsyncRequestSender. When the opCtx is killed due to the maxTimeMS deadline, the ARS stores the status and marks any outstanding remote responses as failed with MaxTimeMSExpired. However, if the shard has already responded before that, the ARS will still return the response from shard. So in that case, the StaleConfig error from the shard will get handled in the mongos retry loop, causing the mongos to mark the shard as stale and send out setShardVersion to the shard which will then fail due to MaxTimeMSExpired. So the command will just keep failing in all next retries.

      The test should instead use checkLog to check for the log lineĀ "Failed to refresh metadata for collection.*MaxTimeMSExpired" on the shard.

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: