From 24136de6170998ada8da1662292f760356974a92 Mon Sep 17 00:00:00 2001 From: Joseph Dougherty Date: Mon, 28 Jun 2021 17:21:17 -0400 Subject: [PATCH] DOCSP-15941 default read concern is always local --- .../fact-readConcern-option-description.rst | 12 +++++------- source/reference/mongodb-defaults.txt | 19 +------------------ source/reference/read-concern-local.txt | 8 ++------ source/reference/read-concern.txt | 17 +---------------- source/release-notes/5.0-compatibility.txt | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 47 deletions(-) diff --git a/source/includes/fact-readConcern-option-description.rst b/source/includes/fact-readConcern-option-description.rst index d513f995dd8..7f87c02e7c3 100644 --- a/source/includes/fact-readConcern-option-description.rst +++ b/source/includes/fact-readConcern-option-description.rst @@ -1,14 +1,12 @@ Possible read concern levels are: - :readconcern:`"local"`. This is the default read concern level for - read operations against primary and read operations against - secondaries when associated with :ref:`causally consistent sessions - `. + read operations against the primary and secondaries. -- :readconcern:`"available"`. This is the default for reads against - secondaries when when not associated with :ref:`causally consistent - sessions `. The query returns the instance's most - recent data. +- :readconcern:`"available"`. Available for read operations against + the primary and secondaries. :readconcern:`"available"` behaves the + same as :readconcern:`"local"` against the primary and non-sharded + secondaries. The query returns the instance's most recent data. - :readconcern:`"majority"`. Available for replica sets that use :ref:`WiredTiger storage engine `. diff --git a/source/reference/mongodb-defaults.txt b/source/reference/mongodb-defaults.txt index 316f49ea27a..a0ab8481450 100644 --- a/source/reference/mongodb-defaults.txt +++ b/source/reference/mongodb-defaults.txt @@ -49,8 +49,7 @@ follows: - This read concern :red:`does not` guarantee :ref:`causal consistency `. - * - | Reads against secondaries if the reads are - | associated with :ref:`causally consistent sessions `. + * - | Reads against secondaries. - :readconcern:`"local"` @@ -63,22 +62,6 @@ follows: consistency `. - * - | Reads against secondaries if the reads are :red:`not` - | associated with :ref:`causally consistent sessions `. - - - :readconcern:`"available"` - - .. note:: - - - This read concern can return data that may be rolled - back. - - - This read concern :red:`does not` guarantee :ref:`causal - consistency `. - - - For sharded collections, this read concern can also return - :red:`orphaned documents`. - .. _mongodb-default-rc-outside-transactions: .. _mongodb-default-rc-txns: diff --git a/source/reference/read-concern-local.txt b/source/reference/read-concern-local.txt index 99ce1e31e75..5e1469321b3 100644 --- a/source/reference/read-concern-local.txt +++ b/source/reference/read-concern-local.txt @@ -17,12 +17,8 @@ A query with read concern ``"local"`` returns data from the instance with no guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). -Read concern ``"local"`` is the default for: - -- read operations against primary - -- read operations against secondaries if the reads are associated with - :ref:`causally consistent sessions `. +Read concern ``"local"`` is the default for read operations against the +primary and secondaries. .. include:: /includes/fact-readConcern-most-recent-data-in-node.rst diff --git a/source/reference/read-concern.txt b/source/reference/read-concern.txt index ff7f1e11ed9..278d04f1cd0 100644 --- a/source/reference/read-concern.txt +++ b/source/reference/read-concern.txt @@ -54,19 +54,7 @@ The following read concern levels are available: the data has been written to a majority of the replica set members (i.e. may be rolled back). - Default for: - - reads against primary - - - reads against secondaries if the reads are - associated with :ref:`causally consistent sessions `. - - .. note:: - - Causally consistent client sessions only guarantee - causal consistency if the associated read operations use - :readconcern:`"majority"` read concern and the - associated write operations use - :writeconcern:`"majority"` write concern. + Default for reads against the primary and secondaries. **Availability:** Read concern :readconcern:`"local"` is available for use with or without causally consistent sessions and @@ -81,9 +69,6 @@ The following read concern levels are available: that the data has been written to a majority of the replica set members (i.e. may be rolled back). - **Default for:** reads against secondaries if the reads are :red:`not` - associated with :ref:`causally consistent sessions `. - **Availability:** Read concern :readconcern:`"available"` is :red:`unavailable for use` with causally consistent sessions and transactions. diff --git a/source/release-notes/5.0-compatibility.txt b/source/release-notes/5.0-compatibility.txt index 55b0fabbadb..09ff7e6c609 100644 --- a/source/release-notes/5.0-compatibility.txt +++ b/source/release-notes/5.0-compatibility.txt @@ -166,6 +166,20 @@ Read Concern ``snapshot`` on Capped Collections .. include:: /includes/extracts/transactions-capped-collection-read-change.rst + +``local`` is the Default Read Concern +------------------------------------- + +Starting in MongoDB 5.0, :readconcern:`"local"` is the default read +concern level for read operations against the primary and secondaries. + +This may introduce a significant latency increase for count queries that +use a filter and for :ref:`covered queries `. + +You can opt out of this behavior by setting the cluster-wide +:ref:`read concern ` with +:dbcommand:`setDefaultRWConcern`. + Update Operator Changes -----------------------