jstests/libs/override_methods/check_indexes_consistent_across_cluster.js
/**
     * Returns a function that returns an array of index docs for the namespace grouped
     * by shard.
     */
Returns a function that returns an array of index docs for the namespace grouped
by shard.
Returns a function that returns an array of index docs for the namespace grouped by shard .
function makeGetIndexDocsFunc(ns) {
        return () => {
            while (true) {
                try {
                    return ShardedIndexUtil.getPerShardIndexes(mongos.getCollection(ns));
                } catch (e) {
                    if (e.code === ErrorCodes.ShardNotFound) {
                        print("Retrying $indexStats aggregation on ShardNotFound error: " +
                              tojson(e));
                        continue;
                    }
                    throw e;
                }
            }
        };
    }
function makeGetIndexDocsFunc ( ns ) { return ( ) => { while ( true ) { try { return ShardedIndexUtil . getPerShardIndexes ( mongos . getCollection ( ns ) ) ; } catch ( e ) { if ( e . code === ErrorCodes . ShardNotFound ) { print ( "Retrying $indexStats aggregation on ShardNotFound error: " + tojson ( e ) ) ; continue ; } throw e ; } } } ; }
Returns a function that returns an array of index docs for the namespace grouped
 by shard.
Returns a function that returns an array of index docs for the namespace grouped by shard .
// Getting the indexes can fail with ShardNotFound if the router's ShardRegistry // reloads after choosing which shards to target and a chosen shard is no longer // in the cluster. This error should be transient, so it can be retried on.