Details
Description
Currently, to make a new replica set shard-aware, during addShard the config server will insert a shard identity document into the new replica set, which triggers shard initialization. SERVER-35486 changes that, so that it instead issues a newly defined _addShard command that will run on the replica set. However, in mixed-version clusters (and therefore in multiversion tests), the _addShard command won't exist on some shards. Therefore, _configsvrAddShard needs to handle the case where the cluster is not fully upgraded. This should be done with proper FCV checking, but since this is not yet available for 4.2, it is currently being done by simply checking if _addShard returns CommandNotFound, and then retrying with a direct insert. Once FCV checking is in place for 4.2, we should change this behavior to use the proper procedure.