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

Change initialization of ShardingState::_rangeDeleterTaskExecutor to make the NetworkInterface externally settable for testing.

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding
    • Sharding 18 (08/05/16)

      _rangeDeleterTaskExecutor is currently initialized by ShardingState::_initializeRangeDeleterTaskExecutor().

      We want to make this a public function, and have it take "NetworkInterface* netPtr" as a parameter with which to initialize the task executor.

      This shiny new public function will get called above this code: https://github.com/mongodb/mongo/blob/master/src/mongo/db/db.cpp#L712-L738, which calls the regular sharding initialization code.

      Now in testing we can set up a task executor with a mock network interface. In ShardingStateTest::setUp, we want to call our shiny new function above this code https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/sharding_state_test.cpp#L135-L139

      And finally we want to test the task executor, so make a test to give it a silly task – e.g. pass in a variable by reference that gets set to some value --, wait for it to finish, check it did what you wanted.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: