Race condition on cluster time value in vector clock unit test

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0, 8.2.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.2
    • CAR Team 2025-11-10, CAR Team 2025-11-24
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Tests that assert on the clusterTime value of the vectorClock may fail due to a race condition caused by the clusterTime bump done by the key generator.

      All these tests have the following structure:
      1. First, enable the key generator. Like here
      2. Second, update the cluster time and keep its new value. Example here.
      3. Verify that the vector clock cluster time is the same as the expected one. Example here.

      The problem is that enabling the key generation spawns an asynchronous task to generate new keys if needed, which will bump the cluster time of the vector clock. If this bumping happens before the cluster time assertion, the test will fail.

      To fix this, we could join the KeysCollectionManager thread and disable it once it has performed one refresh. All this should be done before step 2.

            Assignee:
            Silvia Surroca
            Reporter:
            Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: