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

Interrupt during rename part of map-reduce with "replace" not handled gracefully

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MapReduce
    • Operating System:
      ALL

      Description

      When a map-reduce has "replace" for its output, it writes to a temp collection that gets renamed to the output collection./ This rename has two problems:

      https://github.com/mongodb/mongo/blob/ac2279fdb62d64555e55077ba1113940a24afb04/src/mongo/db/commands/mr.cpp#L716-L723

      1) If the rename gets interrupted, the m/r operation swallows the Interrupted error and instead results in a non-specific error. Calling code doesn't know that the failure was caused by an interrupt.

      2) The output collection has already been deleted. We don't explicitly guarantee that the replacement is atomic, but it's kind of a shame if an interrupt occurs after the old collection has been deleted but before the new output has been renamed, leaving the user with no data.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            justin.seyster Justin Seyster
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: