We call DiscoverTopology as a last step if checkMetadataConsistency fails with CommandNotFound as part of the background hook. Then, we assert that we are NOT running in a sharded cluster because checkMetadataConsistency should exist in that context.
However, we do not throw the last exception — we simply log it. We should ignore all errors coming from DiscoverTopology but throw if we are running in a sharded cluster and found CommandNotFound.