ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1025
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Security
    • Fully Compatible
    • ALL
    • Server Security 2026-10-23
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Problem

      jstests/auth/read_command_max_time_ms_repl_set.js checks default read timeout enforcement on secondaries without waiting for the defaultMaxTimeMS cluster parameter update to be applied on those nodes. BF-46791 records an unexpected successful read at line 96 on the macOS nightly auth task at revision ca116a97f067e8e5fd3732f247167ea049381b40.

      Evidence

      The failing run on 2026-10-12 shows the following UTC timeline:
      * 23:11:08.414: the primary finishes setting defaultMaxTimeMS.readOperations = 1.
      * 23:11:08.415: the primary correctly rejects a read without explicit maxTimeMS with MaxTimeMSExpired.
      * 23:11:08.942: secondary 21091 starts applying creation of config.clusterParameters.
      * 23:11:09.744: the failing secondary connection starts its first command after authenticating as regularUser.
      * 23:11:09.963: secondary 21091 finishes creating config.clusterParameters.
      * 23:11:10.974: the secondary find returns all 10 documents successfully after 1229 ms.

      The read starts before the secondary has finished applying the prerequisite collection creation. Exact in-memory parameter activation timestamps are not logged, but the ordering strongly supports a test synchronization race.

      [Test log|https://parsley.corp.mongodb.com/test/mongodb_mongo_master_nightly_macos_auth_1_macos_ca116a97f067e8e5fd3732f247167ea049381b40_26_10_12_01_13_10/0/3d2cb9334ded1612cb537989dbf5b046]

      Cause

      setClusterParameter uses majority write concern, which does not guarantee application on every secondary. The default timeout is selected from node-local in-memory parameter state at command initialization; later replication catch-up does not retroactively install a deadline. The earlier inserts with w: 3 precede the parameter update and do not synchronize it.

      Proposed Fix

      Add rst.awaitReplication(); immediately after the successful setClusterParameter call at lines 61-63, before the subsequent read assertions. This matches the replica-set cluster parameter checking pattern in jstests/libs/cluster_server_parameter_utils.js. No server behavior change or longer sleep should be needed.

      Acceptance Criteria

      * Wait for the parameter update to be applied on all secondaries before checking default timeout enforcement.
      * Preserve coverage of default timeout enforcement, explicit maxTimeMS overrides, and unaffected write commands.
      * Validate the test with repeated auth-suite runs, including macOS coverage.

      Related Issues

      * BF-46791: observed failure.
      * SERVER-132591 shortened the test sleeps from 1000 ms to 100 ms and may have exposed the missing barrier by reducing incidental waiting; it is not proven to be the introducing change.

      This analysis is based on CI logs and source inspection; no local reproduction has been run.

            Assignee:
            Ken Martin
            Reporter:
            Ken Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: