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.
- is depended on by
-
SERVER-55103 [SBE] Re-enable noPassthrough tests which run into WiredTiger invariant
- Closed
-
SERVER-54624 SBE queries should fail cleanly if catalog epoch changes during yield or between getMores
- Closed