[SERVER-27438] Legacy query via mongos drops $comment Created: 15/Dec/16  Updated: 19/Jun/18  Resolved: 02/Aug/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.4.0
Fix Version/s: 3.4.2, 3.5.2

Type: Bug Priority: Major - P3
Reporter: Bernard Gorman Assignee: Bernard Gorman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-33716 $comment is internally converted to a... Closed
Backwards Compatibility: Major Change
Operating System: ALL
Backport Requested:
v3.4, v3.2
Steps To Reproduce:

1. Spin up a 3.4 sharded cluster
2. Connect to a mongos with a 3.0.x shell, or use db.getMongo().forceReadMode("legacy")
3. Issue a find with a comment, e.g. db.coll.find({...}).comment("TESTCOMMENT")
4. Examine the resulting operation in currentOp or the profiler/logs

Sprint: Query 2017-01-23
Participants:

 Description   

When a legacy query is issued to a mongos with a $comment meta-operator attached, the comment will be dropped before the query is forwarded. This is because the query is transformed to a find command for the shards, but the $comment field is not parsed from the original legacy object and is therefore not added to the final command. A legacy query on a mongod retains the comment since no transformation occurs. This behaviour has been present since 3.2.



 Comments   
Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'gormanb', u'name': u'Bernard Gorman', u'email': u'bernard.gorman@gmail.com'}

Message: SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator

Signed-off-by: James Wahlin <james.wahlin@10gen.com>
(cherry picked from commit e8893fc311ac12028dafcf4416c2f534a42f1cf7)
Branch: v3.4
https://github.com/mongodb/mongo/commit/c24166e10c6547ea03da71a13065df742c3fdd69

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'gormanb', u'name': u'Bernard Gorman', u'email': u'bernard.gorman@gmail.com'}

Message: SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator

Closes #1135

Signed-off-by: James Wahlin <james.wahlin@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/e8893fc311ac12028dafcf4416c2f534a42f1cf7

Comment by Mathias Stearn [ 18/Jan/17 ]

Reopening due to test failure: https://evergreen.mongodb.com/task/mongodb_mongo_master_enterprise_rhel_62_64_bit_sharding_last_stable_mongos_and_mixed_shards_0eeb9396ff46269c2181e5d4aeab629863d875d4_17_01_18_13_13_16

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Revert "SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator"

This reverts commit 0eeb9396ff46269c2181e5d4aeab629863d875d4.
Branch: master
https://github.com/mongodb/mongo/commit/df60eec6052c7a7bcd71d1af31fc4a6f11c4699f

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'gormanb', u'name': u'Bernard Gorman', u'email': u'bernard.gorman@gmail.com'}

Message: SERVER-27438 Prevent mongos from dropping legacy $comment meta-operator

Closes #1135

Signed-off-by: James Wahlin <james.wahlin@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/0eeb9396ff46269c2181e5d4aeab629863d875d4

Generated at Thu Feb 08 04:15:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.