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

Indicate if cleanupOrphaned deleted any documents



    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • None
    • None
    • Sharding
    • Sharding
    • Sharding 10 (02/19/16)


      It would be helpful to be able to keep tabs on when/where orphans are occurring in a cluster. Most of the time, cleanupOrphaned runs without cleaning anything, but we've had instances where the number of orphans went up significantly. In these cases, we didn't realize we had an orphan problem until we started getting reports from users.

      Ideally, we'd be able to get this information from MongoDB so we can investigate proactively. Right now, we use how long cleanupOrphaned takes as a proxy for figuring out if it did any work (e.g. if it returns in under 15s, it probably didn't find any). This produces too many false positives to be useful, though. We've looked at options for parsing this out of logs, but it's not easy to grep for.

      I think a reasonable API would be to add a field, ndeleted to the output of cleanupOrphaned. That would make it easy to setup thresholds by collection for what's worth investigating. Alternatively, a bool field that just indicates if any documents were deleted would probably be sufficient for my use case.


        Issue Links



              backlog-server-sharding Backlog - Sharding Team
              adamaflynn Adam Flynn
              2 Vote for this issue
              9 Start watching this issue