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

read_preference_metrics.js can fail if HMAC key refreshes succeed before transition to secondary

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.19
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2024-09-16
    • 0

      Before running, the test checks in an assert.soon that getReadPreferenceMetrics(rst.getSecondary()).executedOnSecondary.nearest.external >= 2 which is supposed to allow HMAC key refresh commands to run before the test does and avoid interference. 

      This assert can time out if the node manages to run the refresh commands before it actually transitions to secondary, as seen in BF-34648. 

      I don't think the HMAC key refresh having actually happened is important to the test, so we can make this more robust by using the keyRefreshFailWithReadConcernMajorityNotAvailableYet which just makes the refresh continually fail before the point where metrics would be incremented. 

      I believe this actually only needs to be fixed in 6.0 as iirc from SERVER-81762 discussion,  in newer server versions the HMAC key refresh is done by a client marked internal and thus never gets counted here. 

            Assignee:
            ali.mir@mongodb.com Ali Mir
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: