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

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

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: MapReduce
    • Query
    • ALL

      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.

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

              Created:
              Updated:
              Resolved: