Details
Description
A config server stepdown may cause the mongos to retry _configsvrRefineCollectionShardKey even though it has successfully refined the shard key. This results in a StaleEpoch error. Checking that the shard key has already been refined before checking for a StaleEpoch error will fix this bug.