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

Integrate CancelableOperationContext into ReshardingCollectionCloner

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • Sharding 2021-04-05
    • 1

    Description

      The ReshardingCollectionCloner::_withTemporaryOperationContext() method and its lengthy doc comment can be removed. Consider introducing a slim CancelableOperationContextFactory class to avoid the repetition with constructing the CancelableOperationContext by enabling callers to write auto opCtx = factory.makeOperationContext(&cc()); instead.

      class CancelableOperationContextFactory {
      public:
          CancelableOperationContextFactory(CancelationToken cancelToken, ExecutorPtr executor)
              : _cancelToken{std::move(cancelToken)}, _executor{std::move(executor)} {}
       
          CancelableOperationContext makeOperationContext(Client* client) const {
              return CancelableOperationContext{client->makeOperationContext(), _cancelToken, _executor};
          }
       
      private:
          const CancelationToken _cancelToken;
          const ExecutorPtr _executor;
      };
      


      There is a TODO in the codebase referencing a resolved ticket which is assigned to you.

      Please follow this link to see the lines of code referencing this resolved ticket:
      https://github.com/mongodb/mongo/search?q=SERVER-55102&type=Code

      The next steps for this ticket are to either remove the outdated TODO or follow the steps in the TODO if it is correct. If the latter, please update the summary and description of this ticket to represent the work you're actually doing.

      Attachments

        Issue Links

          Activity

            People

              janna.golden@mongodb.com Janna Golden
              dbeng-pm-bot PM Bot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: