Menu Docs

Hedged Read Option

Importante

A partir do MongoDB 8.0, as leituras distribuídas estão obsoletas. As queries que especificam a read preference nearest não usam mais leituras protegidas por padrão. Se você especificar explicitamente uma leitura com hedge, o MongoDB executará uma leitura com hedge e registrará um aviso.

You can specify the use of hedged reads for non-primary read preferences on sharded clusters.

With hedged reads, the mongos instances can route read operations to two replica set members per each queried shard and return results from the first respondent per shard.

As leituras distribuídas são suportadas para as seguintes operações:

To specify hedged read for a read preference, use the hedged read option for read preferences.

To use hedged reads, enable the hedge read option for non-primary read preferences.

For more information on hedged reads, see Leituras cobertas.

For details on member selection for hedged reads, see Leia Preferências e Fragmentos.

O comando serverStatus e seu método correspondente mongosh db.serverStatus() retornam hedgingMetrics.