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

Aggregation text search returns text score even if it wasn't requested when targeting multiple shards in a sharded cluster

    • Fully Compatible
    • ALL
    • v3.6
    • Hide

      I think the easiest way is to try running existing tests: first, apply this patch to run with multiple shards:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      diff --git a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml
      index de8b568eee..68b988f909 100644
      --- a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml
      +++ b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml
      @@ -48,6 +48,7 @@ executor:
           n: 20
         fixture:
           class: ShardedClusterFixture
      +    num_shards: 2
           mongos_options:
             set_parameters:
               enableTestCommands: 1
      

      and then run

      $ python2 buildscripts/resmoke.py --suites aggregation_sharded_collections_passthrough jstests/aggregation/bugs/server11675.js
      

      With this patch applied, I can't reproduce the failure locally:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      diff --git a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml                                                            
      index de8b568eee..1b2963cd71 100644
      --- a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml
      +++ b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml
      @@ -48,9 +48,11 @@ executor:
           n: 20
         fixture:
           class: ShardedClusterFixture
      +    num_shards: 2
           mongos_options:
             set_parameters:
               enableTestCommands: 1
      +        internalQueryProhibitMergingOnMongoS: 1
           mongod_options:
             nopreallocj: ''
             set_parameters:
      
      Show
      I think the easiest way is to try running existing tests: first, apply this patch to run with multiple shards: Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml diff --git a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml index de8b568eee..68b988f909 100644 --- a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml @@ -48,6 +48,7 @@ executor: n: 20 fixture: class: ShardedClusterFixture + num_shards: 2 mongos_options: set_parameters: enableTestCommands: 1 and then run $ python2 buildscripts/resmoke.py --suites aggregation_sharded_collections_passthrough jstests/aggregation/bugs/server11675.js With this patch applied, I can't reproduce the failure locally: Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml diff --git a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml index de8b568eee..1b2963cd71 100644 --- a/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml @@ -48,9 +48,11 @@ executor: n: 20 fixture: class: ShardedClusterFixture + num_shards: 2 mongos_options: set_parameters: enableTestCommands: 1 + internalQueryProhibitMergingOnMongoS: 1 mongod_options: nopreallocj: '' set_parameters:
    • Query 2017-12-18, Query 2018-01-01

      As part of SERVER-31785, I noticed that an aggregation like

      db.coll.aggregate({$match: {$text: {$search: "foo"}}});
      

      will return the text score even though it hasn't been requested. This seems like a bug, as it differs from the behavior of the find command, which does not return the text score. Interestingly, this only occurs when the query targets multiple shards in the cluster. If I add a predicate on the shard key and target one shard, the text score is not included.

      charlie.swanson noted that this might be related to the change in SERVER-22760, which allows merging on mongos for certain pipelines. I've confirmed that this doesn't reproduce when setting internalQueryProhibitMergingOnMongoS, so we should investigate the mongos merging logic.

            Assignee:
            bernard.gorman@mongodb.com Bernard Gorman
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: