Today, for commands that are not allowed on sharded collections, mongos checks its cache and if the cache says the collection is sharded, mongos returns an error to the client without ever contacting any shard.
This is wrong, because mongos's cache could be stale.
Instead, mongos should assume its cache is stale (i.e., assume the collection is unsharded no matter what its cache says) and target the primary shard with shardVersion UNSHARDED. If the collection is actually sharded, the shard will return StaleShardVersion. Mongos should catch StaleShardVersion for these commands and convert it to IllegalOperation (rather than letting it bubble up to the service entry point and making the command be retried repeatedly).
As part of fixing this, we should update the safe_secondary_reads*.js tests' expected behavior of "unshardedOnly" commands.