|
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.
|
|
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.
|