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

Refactor the CollectionRangeDeleter to remove dependency on MetadataManager

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13, Sharding 2020-01-27
    • 32

      The CollectionRangeDeleter is currently extremely complex to reason about. Its main function is a static function that then calls back into a friend class (the MetadataManager) to access an instance of CollectionRangeDeleter, and it has to acquire and release locks to ensure the continued validity of the MetadataManager state as it processes a range. In addition, the logic for scheduling tasks is very complex and spread across a lot of code. It's all very brittle and making changes is extremely difficult.

      We should refactor it so that:
      1) The logic for looping over a batch of documents within a range is clear and consolidated
      2) The logic for cleaning up a range does not rely on the MetadataManager
      3) No collection locks are required except for doing the actual deletion of documents
      4) The logic for scheduling a range for delayed deletion is simplified
      5) The functionality is equivalent

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: