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

Asynchronous operations spawned during lookup should not assume that the CatalogCache is alive

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide

      1. Add a sleep of one second before this line

      2. Run 'build/install/bin/db_s_shard_server_test --filter TestGet'

       

      Show
      1. Add a sleep of one second before this line 2. Run 'build/install/bin/db_s_shard_server_test --filter TestGet'  
    • Sharding 2020-10-19
    • 45

      When we catch an ErrorCodes::ShardInvalidatedForTargeting in here, we end up executing the getCollectionRoutingInfoWithRefresh function. Part of the work of this function is done asynchronously and it doesn't check wether the CatalogCache is still alive.

      The failure happened when executing the resharding_destined_recipient_test.cpp unit tests. More concretely, the data race was between these two points: tearDown and [assertThrow

      https://github.com/mongodb/mongo/blob/45637f4d481c8badd6d5a2d95dcb8ae947c78c92/src/mongo/db/s/resharding_destined_recipient_test.cpp#L266]

      We should change the test, waiting until all the asynchronous work was completed before tearing down everything.
       

            Assignee:
            alex.taskov@mongodb.com Alexander Taskov (Inactive)
            Reporter:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: