[SERVER-43821] Fail in query execution by throwing rather than the FAILURE state code Created: 03/Oct/19 Updated: 29/Oct/23 Resolved: 29/May/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | David Storch |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Query 2020-06-01, Query 2020-06-15 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 13 | ||||||||
| Description |
|
If a PlanStage encounters a runtime failure, it currently is required to allocate a special WorkingSetMember representing a Status object and to return StageState::FAILURE. This forces all PlanStage implementations to be prepared to explicitly handle a FAILURE status from their children, which results in lots of boilerplate. It would be simpler to fail by throwing an exception, like we do if a query fails in DocumentSource execution code. This will also allow us to delete the undesirable code that packs a Status object into a Document. |
| Comments |
| Comment by Githook User [ 29/May/20 ] |
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: This eliminates the need for the FAILURE status codes in |
| Comment by Githook User [ 29/May/20 ] |
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: This eliminates the need for the FAILURE status codes in |
| Comment by David Storch [ 13/May/20 ] |
|
I'm removing this ticket from the "Unify PlanStage and DocumentSource" epic, and assigning it to myself for a future sprint. As part of the SBE work, we will likely end up with a second implementation of the PlanExecutor interface. It would be nice to avoid forcing the SBE PlanExecutor to conform to the legacy engine's error reporting machinery. |