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).