Avoid dropping temporary $out collection if everything succeeded

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.1.11
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • Query 2019-05-06
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      It looks like ever since this commit we started unconditionally dropping the target collection when we're finished with $out mode "replaceCollection". Before this, we would only drop the temp namespace if the command didn't fully succeed since we reset _tempNS after finishing the inserts. Because all of this is happening within the DESTRUCTOR_GUARD, the exception is swallowed and there is no error reported back to the client. So there is no actual impact of this change, but we could probably gain back a little performance and sanity by avoiding dropping a non-existent collection at the end of every $out.

            Assignee:
            Ian Boros
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: