Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43821

Fail in query execution by throwing rather than the FAILURE state code

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • Query 2020-06-01, Query 2020-06-15
    • 13

      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: