[SERVER-9542] Incorrectly coded chunk/shard version comparison Created: 02/May/13  Updated: 11/Jul/16  Resolved: 02/May/13

Status: Closed
Project: Core Server
Component/s: Internal Code, Sharding
Affects Version/s: 2.2.0
Fix Version/s: 2.4.4, 2.5.0

Type: Bug Priority: Minor - P4
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The "<=" comparison operator for chunk/shard versions is incorrectly coded to execute a "<" comparison.

Limited testing suggests minimal impact; adding a "fatal assert" on the missed case (where the values compared are equal) showed that a test for reload failed, leading to unnecessary reloads, but did not reveal other symptoms.

For 2.5 and 2.4, the affected code is in src/mongo/s/chunk_version.h.
For 2.2, the affected code is in src/mongo/s/util.h.



 Comments   
Comment by auto [ 13/May/13 ]

Author:

{u'date': u'2013-05-02T18:34:02Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Change comparison operator to correct type

Do not use "<" to execute a "<=" comparison.
Branch: v2.4
https://github.com/mongodb/mongo/commit/c9cc631ac964aafd5c951ae61e2eb09920be1d81

Comment by auto [ 13/May/13 ]

Author:

{u'date': u'2013-05-02T20:41:30Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Fix incorrect unit test

Unit test was passing due to the bug fixed in SERVER-9542. We
SHOULD get an error when trying to cloneMinus to the same version.
Changed the test to use a higher major version so that no error
message will be returned.
Branch: v2.4
https://github.com/mongodb/mongo/commit/47c04a148e801116985394a4afb22c4b492ed0ee

Comment by auto [ 13/May/13 ]

Author:

{u'date': u'2013-05-02T20:41:30Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Fix incorrect unit test

Unit test was passing due to the bug fixed in SERVER-9542. We
SHOULD get an error when trying to cloneMinus to the same version.
Changed the test to use a higher major version so that no error
message will be returned.
Branch: v2.4
https://github.com/mongodb/mongo/commit/47c04a148e801116985394a4afb22c4b492ed0ee

Comment by auto [ 02/May/13 ]

Author:

{u'date': u'2013-05-02T20:41:30Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Fix incorrect unit test

Unit test was passing due to the bug fixed in SERVER-9542. We
SHOULD get an error when trying to cloneMinus to the same version.
Changed the test to use a higher major version so that no error
message will be returned.
Branch: master
https://github.com/mongodb/mongo/commit/1930908cf3dc4ee2ca5db7b94625338af0cc6d13

Comment by auto [ 02/May/13 ]

Author:

{u'date': u'2013-05-02T20:41:30Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Fix incorrect unit test

Unit test was passing due to the bug fixed in SERVER-9542. We
SHOULD get an error when trying to cloneMinus to the same version.
Changed the test to use a higher major version so that no error
message will be returned.
Branch: master
https://github.com/mongodb/mongo/commit/1930908cf3dc4ee2ca5db7b94625338af0cc6d13

Comment by Tad Marshall [ 02/May/13 ]

The code change showed that one of the unit tests was broken ... collection_manager_test.cpp.

Comment by auto [ 02/May/13 ]

Author:

{u'date': u'2013-05-02T18:34:02Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-9542 Change comparison operator to correct type

Do not use "<" to execute a "<=" comparison.
Branch: master
https://github.com/mongodb/mongo/commit/623683b0f717769626381f4d3fb6f62170ffd137

Generated at Thu Feb 08 03:20:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.