[SERVER-33355] Support readConcern level snapshot reads on secondaries Created: 15/Feb/18  Updated: 29/Oct/23  Resolved: 03/Mar/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Task Priority: Major - P3
Reporter: James Wahlin Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Storage NYC 2018-03-12
Participants:

 Comments   
Comment by Githook User [ 03/Mar/18 ]

Author:

{'email': 'james@mongodb.com', 'name': 'James Wahlin', 'username': 'jameswahlin'}

Message: SERVER-33355 Support readConcern level snapshot reads on secondaries
Branch: master
https://github.com/mongodb/mongo/commit/13b8e62cd9609f10688a1896cb80efa5d3c82859

Comment by Judah Schvimer [ 16/Feb/18 ]

When we reenable snapshot reads on secondaries, we also need to fix readConcern_atClusterTime_snapshot_selection.js. The test stops data replication on the secondaries before waiting for them to commit the "clusterTimeBefore". Given the possibility of losing a sync source, there's no way to guarantee it’ll get into the majority snapshot without the "clusterTimeBefore" lagging behind the commit point, which means we might no longer be able to read at that time. To fix this, tess.avitabile suggested the best course of action is to get the majority snapshot optime like here and do secondary reads at that time. Since we already waited for the "before" write to be committed here, the before write will be guaranteed to be in the majority committed snapshot when we do the read.

Comment by James Wahlin [ 15/Feb/18 ]

One specific issue is that WiredTigerOplogManager::waitForAllEarlierOplogWritesToBeVisible(), which is called when performing snapshot reads on secondaries, will attempt to abandon the WiredTiger transaction while held in a WriteUnitOfWork, triggering an invariant.

Generated at Thu Feb 08 04:33:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.