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

Implement CollectionRangeDeleter task lifetime management

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 16 (06/24/16), Sharding 18 (08/05/16)

      This task is to thread-through the creation and cleanup of the CollectionRangeDeleter object. A single instance must exist at any given time, if and only if there are entries in the MetadataManager::_rangesToClean object and it should be created the first time an entry is put in there.

      You'll need to implement the following:

          CollectionRangeDeleter::run() {
              if (cleanupNext())
                  (range deleter task executor).scheduleTask()
              else
                  delete this
          }
      

      And in MetadataManager, you'll need to create the CollectionRangeDeleter and schedule the task in MetadataManager::addToRTC, which should do so if the rangesToClean was previously empty. The CollectionRangeDeleter should be created on the heap, and then CollectionRangeDeleter::run() will handle deleting it when it is finished.

      Once that is implemented, we'll need to figure out how to clean up the CollectionRangeDeleter object when the server crashes/shutsdown/something bad happens to the scheduled task on the task executor.

      This also involves writing unit-tests.

            Assignee:
            sam.dunietz Sam Dunietz
            Reporter:
            crystal.horn@mongodb.com Crystal Horn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: