[SERVER-54889] Nested LFR collection helpers must not try to re-establish read source Created: 02/Mar/21  Updated: 29/Oct/23  Resolved: 24/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-55103 [SBE] Re-enable noPassthrough tests w... Closed
is depended on by SERVER-54624 SBE queries should fail cleanly if ca... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.9
Sprint: Execution Team 2021-03-22, Execution Team 2021-04-05
Participants:
Linked BF Score: 122

 Description   

TLDR; we still run the read source selection code in nested lock-free collection helpers. That read source selection may attempt to open a snapshot via RecoveryUnit::setTimestampReadSource(), which invariants if a snapshot is already open.

We must not try to re-establish the read source. We already have a matching in-mem and on-disk snapshot at that point and should just run with it, disregarding repl state changes.
-------------------------------------------------------
My analysis from the test failure ticket:

SBE has multiple AutoGetColl*LockFree instances in play. I think we opened a snapshot in one AutoGet*LockFree in mode secondary, stepped up to PRIMARY, and then in a subsequent AutoGet*LockFree this code to select read source ran a second time returning a different result and provoked another setTimestampReadSource() request that invariant'ed on an already open snapshot.

I think our problem is that nested AutoGet*LockFree still run the establish read source logic repeatedly along with the Collection fetch.



 Comments   
Comment by Githook User [ 24/Mar/21 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-54889 Nested LFR collection helpers must not try to re-establish read source
Branch: master
https://github.com/mongodb/mongo/commit/d18d6234db7e647b0615df8de01a027df151a97d

Comment by David Storch [ 03/Mar/21 ]

dianna.hohensee while working SERVER-50710, I found that my changes seemed to cause this problem to occur more frequently (or perhaps I just observed the pre-existing failure in new noPassthrough tests). I added the sbe_incompatible tag to the tests in question and also added a "TODO SERVER-54889" comment referring to this ticket. As part of the work for this ticket, please make sure that we re-enable these tests in the SBE build variant. The specific tests which need to be re-enabled are:

  • jstests/noPassthrough/capped_deletes_within_rollback.js
  • jstests/noPassthrough/capped_deletes_within_startup_recovery.js
  • jstests/noPassthrough/index_abort_stepdown_prepare.js
  • jstests/noPassthrough/index_stepdown_prepare_conflict.js
Generated at Thu Feb 08 05:34:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.