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.
- related to
-
SERVER-15408 cleanupOrphaned should output progress
- Closed
-
SERVER-17013 Add 'dry run' mode for cleanupOrphaned
- Closed