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

Interrupt OplogBufferMock::waitForData on shutdown

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0, 5.0.10
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Sharding EMEA 2022-03-07

      tenant_oplog_applier_test takes ~36 seconds to run. This slowness is due to the shutdown & join of the TenantOplogApplier that is done at the end of every test case.

      In particular as part of the shutdown of the TenantOplogApplier we shutdown also the underlying _oplogBatcher.

      The problem is that when we shutdown the TenantOplogBatcher, the batcher won't actually move to the kComplete state until the last call to _oplogBuffer->waitForData(Seconds(1)) complete.
      So practically every time a test case end it will block 1 seconds waiting to join the TenantOplogApplier.

      In order to reduce this delay we should shutdown the oplogBuffer before to join the TenantOplogApplier that is using it and make that this shoutdown interrupts also the waiForData function.

      With the proposed changes the test run time drop from ~36 seconds to ~2 seconds.

            Assignee:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: