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

Fix timeseries query failing in explain, but passing when running

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • ALL

      While working on SERVER-93881 we introduced a query_shape_hash_stability suite that runs explain on each query multiple times and ensures that reported QueryShapeHash value is same.

      However, jstests/core/timeseries/timeseries_union_with.js had to be excluded because while the run() command succeeded, the explain() failed for the given query:

       

      {
              "aggregate" : "a",
              "pipeline" : [
                      {
                              "$unionWith" : {
                                      "coll" : "b",
                                      "pipeline" : [
                                              {
                                                      "$match" : {
                                                              "$expr" : {
                                                                      "$eq" : [
                                                                              {
                                                                                      "$mod" : [
                                                                                              {
                                                                                                      "$toInt" : {
                                                                                                              "$substr" : [
                                                                                                                      "$tags.hostname",
                                                                                                                      5,
                                                                                                                      -1
                                                                                                              ]
                                                                                                      }
                                                                                              },
                                                                                              2
                                                                                      ]
                                                                              },
                                                                              0
                                                                      ]
                                                              }
                                                      }
                                              }
                                      ]
                              }
                      },
                      {
                              "$group" : {
                                      "_id" : "$tags.hostname",
                                      "count" : {
                                              "$sum" : 1
                                      }
                              }
                      },
                      {
                              "$sort" : {
                                      "_id" : 1
                              }
                      }
              ],
              "cursor" : {        },
              "lsid" : {
                      "id" : UUID("ba0aa2a3-b85d-4096-8312-40ba6759f158")
              },
              "$clusterTime" : {
                      "clusterTime" : Timestamp(1727271933, 20),
                      "signature" : {
                              "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                              "keyId" : NumberLong(0)
                      }
              }
      }

      Related patch run: https://parsley.mongodb.com/test/mongodb_mongo_master_enterprise_rhel_8_64_bit_dynamic_classic_engine_query_patch_only_query_shape_hash_stability_patch_02631a94f75816654a4fe7f126fd858a69e32a1d_66f2a5a837ceb00007ef383f_24_09_24_11_43_06/0/49d93dc60fa6dfcb962f58c53a4ed46f?bookmarks=0,418&shareLine=0 

       

            Assignee:
            arun.banala@mongodb.com Arun Banala
            Reporter:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: