Many callers of PlanExecutor::restoreState() ignore the return value

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • None
    • Query 2018-01-15
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      PlanExecutor::restoreState() returns a boolean indicating whether it's safe to use. If a WriteConflictException is encountered while restoring, we may need to yield to recover. If this is the case, some event like a collection drop could invalidate the PlanExecutor. It seems like maybe it's safe to continue after this happens, since most callers immediately call PlanExecutor::getNext afterwards, which checks if it was killed and will return PlanExecutor::DEAD immediately.

      We should either make all callers handle the return value, or change it to return void if it's safe. It seems better to handle it - since calling restoreState() might leave you in a state where you have no locks.

            Assignee:
            Charlie Swanson
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: