Stop attaching to the root cancelToken in resharding

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The resharding service has a common pattern where we create a CancelableOperationContextFactory and pass it the root cancelToken. This means that everytime we call CancelableOperationContextFactory::makeOperationContext, we end up creating new listeners to that token. This is known to be problematic due to SERVER-103945.

      We should instead create hierarchies, like create new child token in certain parts of resharding in order to limit attaching new listeners to the root cancelToken. These child token will still need to be attached to the root token, but the grand children will attach to it (instead of the root token) so it should limit the memory usage since the memory usage associated with tokens tied to the grandchildren can be freed when it goes away.

            Assignee:
            Unassigned
            Reporter:
            Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: