Map "last-patch" to fcvConstants.latest instead of shellVersion() in MongoRunner.binVersionSubs

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.0.1, 9.0.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Test Infrastructure
    • Fully Compatible
    • v9.0, v8.3, v8.0
    • DevProd Test Infra 2026-08-11
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      MongoRunner.binVersionSubs (src/mongo/shell/servers.js) maps the "last-patch" version alias to
      shellVersion(), the full patch+githash version string of the current checkout. This is the wrong
      mapping and causes spurious multiversion test failures (e.g. jstests/core/testing/
      mixed_version_replica_set.js) with an assertion like:

      MongoDB versions must have at least two components to compare, but "..." has ...

      or a numeric mismatch assertion from MongoRunner.compareBinVersions.

      Root cause:
      MongoRunner.compareBinVersions only compares as many version components as the shorter of the
      two strings being compared. shellVersion() carries 3+ components (major.minor.patch-githash), so
      comparing against it forces an exact patch-number match between the real "old" binary under test
      and the current checkout's own declared version.

      This breaks in at least two ways:
      1. The last-patch reachability fallback in db-contrib-tool can legitimately resolve to an older
      patch than the checkout's latest tag (e.g. requesting 8.3.8 but falling back to 8.3.7 because
      8.3.8's binary isn't published to the download feed yet).
      2. A checkout's own declared dev-version target (e.g. .bazelrc.target_mongo_version) can itself be
      stale relative to the branch's actual release tags, independent of (1).

            Assignee:
            Nicholas Jefferies
            Reporter:
            Nicholas Jefferies
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: