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

ReshardingDonorServiceTest should wait for donor to be "donating-initial-data" state before starting the ReshardingChangeStreamsMonitor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • Cluster Scalability 2025-03-17
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The notifyToStartChangeStreamsMonitor calls ReshardingDonorService::DonorStateMachine::createAndStartChangeStreamsMonitor which uses _cancelableOpCtxFactory. Currently, notifyToStartChangeStreamsMonitor is called immediately after the DonorStateMachine so the _cancelableOpCtxFactory might not have been initialized yet because run() is called asynchronously. This is a test-only issue since in a non-test setup createAndStartChangeStreamsMonitor (i.e. _shardsvrReshardingDonorStartChangStreamsMonitor) is by design called after the donor is already in the "donating-initial-data" state, therefore has already initialized _cancelableOpCtxFactory. 

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: