[SERVER-60325] Stop DocumentSourceCursorTest from calling saveState() twice in a row Created: 29/Sep/21  Updated: 29/Oct/23  Resolved: 30/Sep/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

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

Issue Links:
Depends
is depended on by SERVER-59178 Re-enable SBE as the default executio... Closed
Related
is related to SERVER-60355 Investigate whether there are unneces... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2021-10-04
Participants:

 Description   

Logs

When SBE is turned on, this invariant fails:

invariant(_saveState == SaveState::kNotSaved);

This is because DocumentSourceCursorTest seems to call saveState() twice in a row. We should investigate why it does this, and remove one of these calls if it is reasonable to do so.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Jennifer Peshansky (Inactive) [ 30/Sep/21 ]

Filed SERVER-60355 as a follow-up to this.

Comment by Githook User [ 30/Sep/21 ]

Author:

{'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}

Message: SERVER-60325 Remove extraneous call to exec->saveState() in documentsourcetests.cpp
Branch: master
https://github.com/mongodb/mongo/commit/9f8e95a95b592c3686dcb1aa82ebcd9b7515974b

Comment by Jennifer Peshansky (Inactive) [ 29/Sep/21 ]

Within the test, saveState() is called here. It looks like we're also calling it somewhere else along the way.

Here is the failing test.

My current best guess is that it has something to do with the call to saveState here, within plan_yield_policy.cpp. We reference plan_yield_policy in the getExecutor call here:

auto exec = uassertStatusOK(getExecutor(opCtx(),
&_coll,
std::move(cq),
nullptr /* extractAndAttachPipelineStages */,
PlanYieldPolicy::YieldPolicy::NO_YIELD,
QueryPlannerParams::RETURN_OWNED_DATA));

exec->saveState();

I believe I just need to remove the extraneous call to exec->saveState() here.

Generated at Thu Feb 08 05:49:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.