[SERVER-30410] Make sure PlanExecutor is saved when leaving DocumentSourceCursor::loadBatch() Created: 28/Jul/17  Updated: 30/Oct/23  Resolved: 28/Aug/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.5.13

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-30414 Many callers of PlanExecutor::restore... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2017-08-21, Repl 2017-09-11
Participants:
Linked BF Score: 0

 Description   

An exception can be thrown during a call to PlanExecutor::getNext() if the operation times out. When this happens, we can leave DocumentSourceCursor::loadBatch() without saving state on the PlanExecutor. Normally this wouldn't be a problem, since the whole Pipeline is about to be destroyed and we will never use it again. However, now that we've introduced tailable aggregation cursors as part of the work for change streams, it's possible that we will continue using the pipeline after timing out. (There is logic in the getMore command to ignore this particular error condition for tailable cursors)

There are a couple approaches we could take to resolve this, two come to mind:

  • Change PlanExecutor to swallow this error if it's tailable, and just return EOF instead.
  • Change DocumentSourceCursor to extend it's ON_BLOCK_EXIT to make sure to save the state of the PlanExecutor.


 Comments   
Comment by Githook User [ 28/Aug/17 ]

Author:

{'username': 'cswanson310', 'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com'}

Message: SERVER-30410 Ensure executor is saved after tailable cursor time out.
Branch: master
https://github.com/mongodb/mongo/commit/55a85da4980f1967f88bbccbd43646ee89c6301f

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