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

Reconsider API parameters for config server commands

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.8.0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • Repl 2020-08-24, Repl 2020-09-07, Repl 2020-09-21

      There are two mongos commands in API Version 1 that forward their parameters to internal commands: "drop" forwards to "_configsvrDropCollection" and "dropDatabase" forwards to "_configsvrDropDatabase". Users should be permitted to call the mongos commands with apiVersion: "1", apiStrict: true, but if the internal commands aren't in Version 1 they'll reject these parameters.

      In detail: a client call to "drop" (or "dropDatabase") on mongos with apiVersion: "1" and apiStrict: true follows these steps:

      1. mongos receives the "drop" request with apiVersion: "1" and apiStrict: true in cluster_drop_cmd.cpp 
      2. mongos builds a "_configsvrDropCollection" command for the config primary
      3. mongos copies some fields from the "drop" request to the "_configsvrDropCollection" command with CommandHelpers::appendPassthroughFields. The API parameters are copied since they are not marked stripFromRequest in command_generic_argument.cpp
      4. The config primary receives "_configsvrDropCollection" with apiVersion: "1" and apiStrict: true
      5. The "_configsvrDropCollection" command rejects the request because it isn't in API Version 1.

      In SERVER-49065 we fixed this by marking _configsvrDropCollection and _configsvrDropDatabase as part of API Version 1. But since _configsvrDropCollection/Database are internal commands they probably shouldn't be in API V1. Let's find a different way to support API version parameters in drop and dropDatabase on mongos.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: