-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
ALL
-
v4.2
-
Sharding 2019-08-26
-
12
This check in shards_and_config_return_last_committed_optime.js is meant to succeed if the opTime in a command response is <= the last committed opTime returned from replSetGetStatus. The timestamps are compared using bsonWoCompare, which returns -1 if the first argument is smaller and 0 if the two arguments are equal. Currently the test uses assert.lte(0, <bsonWoCompare result>), which throws if 0 is not less than or equal to the result, so will incorrectly fail if the result is -1. The order of the arguments passed to assert.lte should be flipped.