jstests/sharding/query/lookup_mongod_unaware.js
// Restarts the primary shard and ensures that it believes both collections are unsharded.
Restarts the primary shard and ensures that it believes both collections are unsharded.
Restarts the primary shard and ensures that it believes both collections are unsharded .
function restartPrimaryShard(rs, localColl, foreignColl) {
    function hasRoutingInfoForNs(shardConn, coll) {
        const res = shardConn.adminCommand({getShardVersion: coll, fullMetadata: true});
        assert.commandWorked(res);
        return res.metadata.collVersion != undefined;
    }
    rs.restart(0);
    rs.awaitSecondaryNodes();
    assert(!hasRoutingInfoForNs(rs.getPrimary(), localColl.getFullName()));
    assert(!hasRoutingInfoForNs(rs.getPrimary(), foreignColl.getFullName()));
}
function restartPrimaryShard ( rs , localColl , foreignColl ) { function hasRoutingInfoForNs ( shardConn , coll ) { const res = shardConn . adminCommand ( { getShardVersion : coll , fullMetadata : true } ) ; assert . commandWorked ( res ) ; return res . metadata . collVersion != undefined ; } rs . restart ( 0 ) ; rs . awaitSecondaryNodes ( ) ; assert ( ! hasRoutingInfoForNs ( rs . getPrimary ( ) , localColl . getFullName ( ) ) ) ; assert ( ! hasRoutingInfoForNs ( rs . getPrimary ( ) , foreignColl . getFullName ( ) ) ) ; }
Restarts the primary shard and ensures that it believes both collections are unsharded.
Restarts the primary shard and ensures that it believes both collections are unsharded .
// Returns true if the shard is aware that the collection is sharded.