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

Improve concurrency rule for cancellation use in resharding

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      The current pattern we have in resharding is to use a CancelableOperationContextFactory that is initialized with the abortToken at the beginning and swap it later to use the stepDown token. Anything that uses the factory within the future chain is safe to do so since they are executed serially and will never interleave. However, there are some cases where tasks are executed asynchronously outside of the main future chain and uses the factory. These cases have to ensure that the factory is copied to the async task and not it's reference. It is easy to make a mistake and it's not immediately obvious when it happens. We should try to make it hard to mistakenly do the wrong thing by either providing some API to make it obvious when factory is being used in the main future chain or outside of it or change the model so this problem no longer exists.

            Assignee:
            Unassigned Unassigned
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: