Skip to content

DOCS-11245, DOCS-11470: read concern snapshot part 1 #3292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions source/reference/read-concern-local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Read Concern ``"local"``
========================

.. meta::
:description: read concern, local read concern, read isolation
:keywords: read concern, local read concern, read isolation
:description: read concern, local read concern, read isolation, transactions, multi-document transactions
:keywords: read concern, local read concern, read isolation, transactions, multi-document transactions


A query with read concern ``"local"`` returns the instance's most
Expand All @@ -33,6 +33,40 @@ Causally Consistent Sessions
Read concern :readconcern:`local` is available for use with causally
consistent sessions.

Read Concern ``"local"`` and Transactions
--------------------------------------------

In a multi-document transaction, read concern levels
:readconcern:`"local"` and :readconcern:`"snapshot"` are available for
:ref:`read and write operations that support read concern in a
transaction <read-concern-operations>`.

.. note::

For the operations in a transaction, you set the read concern at the
transaction level, not at the individual operation level.

.. seealso:: :readconcern:`"snapshot"`

Write Operations and Read Concern ``"local"``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In a multi-document transaction, both the read operations and the write
operations can accept the read concern level :readconcern:`"local"`.
The following write operations can accept a read concern level as part
of a transaction:

- :dbcommand:`delete`

- :dbcommand:`findAndModify`

- :dbcommand:`insert`

- :dbcommand:`update`

For a list of all operations that accept read concerns, see
:ref:`read-concern-operations`.

Example
-------

Expand Down
75 changes: 75 additions & 0 deletions source/reference/read-concern-snapshot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.. default-domain:: mongodb

.. class:: hidden

.. readconcern:: "snapshot"

===========================
Read Concern ``"snapshot"``
===========================

.. meta::
:description: read concern, snapshot read concern, read isolation, transactions, multi-document transactions
:keywords: read concern, snapshot read concern, read isolation, transactions, multi-document transactions

.. versionadded:: 4.0

Read concern ``"snapshot"`` is only available for multi-document
transactions.

- If the transaction is not part of a :ref:`causally consistent session
<sessions>`, operations with read concern ``"snapshot"`` reads data
from a snapshot of the most recent majority committed data at
transaction start.

- If the transaction is part of a :ref:`causally consistent session
<sessions>`, operations with read concern ``"snapshot"`` reads data
from a snapshot of the first majority committed data that guarantees
causal consistency with the operation immediately prior to the
transaction start. The time of the snapshot may be after the
transaction start to guarantee causal consistency.

Read Concern ``"snapshot"`` and Transactions
--------------------------------------------

In a multi-document transaction, read concern levels
:readconcern:`"local"` and :readconcern:`"snapshot"` are available for
:ref:`read and write operations that support read concern in a
transaction <read-concern-operations>`.

.. note::

For the operations in a transaction, you set the read concern at the
transaction level, not at the individual operation level.

.. seealso:: :readconcern:`"local"`

Write Operations and Read Concern ``"snapshot"``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In a multi-document transaction, both the read operations and the write
operations can accept the read concern level :readconcern:`"snapshot"`.
The following write operations can accept a read concern level as part
of a transaction:

- :dbcommand:`delete`

- :dbcommand:`findAndModify`

- :dbcommand:`insert`

- :dbcommand:`update`

For a list of all operations that accept read concerns, see
:ref:`read-concern-operations`.

Causally Consistent Sessions
----------------------------

:readconcern:`snapshot` is available for transactions that are part of
a causally consistent session.

If the transaction is part of a :ref:`causally consistent session
<sessions>`, the snapshot of the majority committed data reflects the
earliest time from the transaction start time(inclusive) that
guarantees causally consistency with the prior operation in the session.
Loading