@@ -93,6 +93,7 @@ var ReplSetTest = function(opts) {
9393 var _allocatePortForBridge ;
9494
9595 var _causalConsistency ;
96+ var _isMultiVersion = false ;
9697
9798 // Some code still references kDefaultTimeoutMS as a (non-static) member variable, so make sure
9899 // it's still accessible that way.
@@ -1583,8 +1584,12 @@ var ReplSetTest = function(opts) {
15831584 // unreplicated "tmp.mr." collection may be left behind. We remove it from the
15841585 // dbHash command response to avoid an already known case of a mismatch.
15851586 // TODO SERVER-27147: Stop filtering out "tmp.mr." collections.
1587+ //
1588+ // TODO SERVER-43072: Stop filtering out 'system.keys' once 'last-stable' servers
1589+ // return 'system.keys' collections in dbhash responses (when 'last-stable' is 4.4).
15861590 if ( cappedCollections . has ( collName ) ||
1587- ( filterMapReduce && collName . startsWith ( "tmp.mr." ) ) ) {
1591+ ( filterMapReduce && collName . startsWith ( "tmp.mr." ) ||
1592+ ( _isMultiVersion && collName === "system.keys" ) ) ) {
15881593 delete res . collections [ collName ] ;
15891594 // The "uuids" field in the dbHash command response is new as of MongoDB 4.0.
15901595 if ( res . hasOwnProperty ( "uuids" ) ) {
@@ -1979,7 +1984,11 @@ var ReplSetTest = function(opts) {
19791984 // If the primary and secondary have the same hashes for all the
19801985 // collections in the database and there aren't any capped collections,
19811986 // then the hashes for the whole database should match.
1982- if ( primaryDBHash . md5 !== secondaryDBHash . md5 ) {
1987+
1988+ // TODO SERVER-43072: Remove isMultiVersion exemption once 'last-stable'
1989+ // servers return 'system.keys' collections in dbhash responses (when
1990+ // 'last-stable' is 4.4).
1991+ if ( ! _isMultiVersion && ( primaryDBHash . md5 !== secondaryDBHash . md5 ) ) {
19831992 print ( msgPrefix +
19841993 ', the primary and secondary have a different hash for ' +
19851994 'the ' + dbName + ' database: ' + tojson ( dbHashes ) ) ;
@@ -2326,6 +2335,10 @@ var ReplSetTest = function(opts) {
23262335 throw new Error ( "Failed to start node " + n ) ;
23272336 }
23282337
2338+ if ( options . binVersion ) {
2339+ _isMultiVersion = true ;
2340+ }
2341+
23292342 // Make sure to call _addPath, otherwise folders won't be cleaned.
23302343 this . _addPath ( conn . dbpath ) ;
23312344
0 commit comments