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

Race of OplogFetcher access in TenantMigrationRecipientServiceTest.OplogApplierFails

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.9.0
    • None
    • None
    • Fully Compatible
    • ALL
    • Repl 2021-01-25
    • 0

    Description

      In this OplogApplierFails test, we use an OplogFetcherMock to feed an oplog entry that doesn't belong to the tenant to test that TenantOplogApplier fails the migration. When failing the migration, the main chain would call _cleanupOnDataSyncCompletion which would clean up and free the _donorOplogFetcher. But this could race with the test thread that calls oplogFetcher->receiveBatch which could end up accessing freed memory if the _donorOplogFetcher object is freed before the receiveBatch returns.

      To fix this, we could use the hangBeforeTaskCompletion failpoint to hang the main chain before _cleanupOnDataSyncCompletion is run.

      Attachments

        Activity

          People

            lingzhi.deng@mongodb.com Lingzhi Deng
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: