File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3030
3131 res = st . rs0 . getPrimary ( ) . adminCommand ( { replSetGetStatus : 1 } ) ;
3232
33+ // Cluster time may advance after replSetGetStatus finishes executing and before its logical
34+ // time metadata is computed, in which case the response's $clusterTime will be greater than the
35+ // appliedOpTime timestamp in its body. Assert the timestamp is <= $clusterTime to account for
36+ // this.
3337 var appliedTime = res . optimes . appliedOpTime . ts ;
3438 var logicalTimeMetadata = res . $clusterTime ;
35- assert . eq ( 0 ,
36- timestampCmp ( appliedTime , logicalTimeMetadata . clusterTime ) ,
37- 'appliedTime: ' + tojson ( appliedTime ) + ' != clusterTime: ' +
38- tojson ( logicalTimeMetadata . clusterTime ) ) ;
39+ assert . lte ( 0 ,
40+ timestampCmp ( appliedTime , logicalTimeMetadata . clusterTime ) ,
41+ 'appliedTime: ' + tojson ( appliedTime ) + ' not less than or equal to clusterTime: ' +
42+ tojson ( logicalTimeMetadata . clusterTime ) ) ;
3943
4044 assert . commandWorked ( db . runCommand ( { ping : 1 , '$clusterTime' : logicalTimeMetadata } ) ) ;
4145
You can’t perform that action at this time.
0 commit comments