Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27438

Legacy query via mongos drops $comment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.2, 3.5.2
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Major Change
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2
    • Steps To Reproduce:
      Hide

      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

      Show
      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

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: