[SERVER-48452] Internal readers should default to reading without a timestamp Created: 27/May/20  Updated: 29/Oct/23  Resolved: 10/Sep/20

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 4.4.0
Fix Version/s: 4.8.0, 4.4.2

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-49781 Setting lastApplied before startup re... Closed
Related
related to SERVER-80280 Consider introducing concept of drain... Closed
related to SERVER-79955 Need a more complete mechanism for in... Closed
related to SERVER-51430 update log message search in recovery... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.7, v4.4
Sprint: Execution Team 2020-09-07, Execution Team 2020-09-21
Participants:

 Description   

Internal readers should default to using the kNoTimestamp ReadSource. Users of AutoGetCollectionForRead are subject to having their ReadSource changed, which is not always desirable and leads to unexpected behavior.

Since internal readers have a "local" readConcern by default, despite not originating from a command, they are still eligible for changing their ReadSource.

Only reads originating from commands should change their ReadSource.



 Comments   
Comment by Githook User [ 15/Sep/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48452 Internal readers should default to reading without a timestamp

Removes ReadSource::kUnset in favor of kNoTimestamp as the default

Makes the following behavioral changes to AutoGetCollectionForRead:

  • Removes special early-return handling for kNoTimestamp
  • Only user or DBDirectClient operations are eligible to read at
    kLastApplied.
  • Operations only read at kLastApplied when in the SECONDARY state, nothing
    else. This means most internal operations that use DBDirectClient do not need
    to use a ReadSourceScope to ensure they read at kNoTimestamp.

(cherry picked from commit 11c68393df88a6f1ea4855e6ac15e54ca9f9d976)
Branch: v4.4
https://github.com/mongodb/mongo/commit/a68bbe9d37f0c576295016919c9e0595c4ec1427

Comment by Githook User [ 10/Sep/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48452 Internal readers should default to reading without a timestamp

Removes ReadSource::kUnset in favor of kNoTimestamp as the default

Makes the following behavioral changes to AutoGetCollectionForRead:

  • Removes special early-return handling for kNoTimestamp
  • Only user or DBDirectClient operations are eligible to read at
    kLastApplied.
  • Operations only read at kLastApplied when in the SECONDARY state, nothing
    else. This means most internal operations that use DBDirectClient do not need
    to use a ReadSourceScope to ensure they read at kNoTimestamp.
    Branch: master
    https://github.com/mongodb/mongo/commit/11c68393df88a6f1ea4855e6ac15e54ca9f9d976
Generated at Thu Feb 08 05:17:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.