[SERVER-54042] Time-series collection queries return incorrect results when using CST Created: 26/Jan/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-53746 Disable cst_jscore_passthrough suite ... Closed
Related
related to SERVER-53987 Do not create the _id index for time-... Closed
related to SERVER-54428 Complete TODO listed in SERVER-54042 Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

While working on SERVER-53987 I came across these failures in my patch isolated to the cst_jscore_passthrough suite. I've disabled these tests in cst_jscore_passthrough.yml for the time being.

Looking at the timeseries_bucket_limit_count.js failure, the query is returning incorrect results. We expect 1100 documents but only get 2.

assert: [1100] != [2] are not equal : [ { "x" : 0, "_id" : 0 }, { "x" : 1000, "_id" : 1000 } ]
doassert@src/mongo/shell/assert.js:20:14
assert.eq@src/mongo/shell/assert.js:179:9
runTest@jstests/core/timeseries/timeseries_bucket_limit_count.js:52:5
@jstests/core/timeseries/timeseries_bucket_limit_count.js:93:1
@jstests/core/timeseries/timeseries_bucket_limit_count.js:13:2

I printed the explain() output, but couldn't see anything out of the ordinary:

 {
   "stages" : [
           {
                   "$cursor" : {
                           "queryPlanner" : {
                                   "plannerVersion" : 1,
                                   "namespace" : "timeseries_bucket_limit_count.system.buckets.t_1",
                                   "indexFilterSet" : false,
                                   "parsedQuery" : {
                                   },
                                   "queryHash" : "8B3D4AB8",
                                   "planCacheKey" : "8B3D4AB8",
                                   "maxIndexedOrSolutionsReached" : false,
                                   "maxIndexedAndSolutionsReached" : false,
                                   "maxScansToExplodeReached" : false,
                                   "winningPlan" : {
                                           "stage" : "COLLSCAN",
                                           "direction" : "forward"
                                   },
                                   "rejectedPlans" : [ ]
                           }
                   }
           },
           {
                   "$_internalUnpackBucket" : {
                           "exclude" : [ ],
                           "timeField" : "time"
                   }
           },
           {
                   "$project" : {
                           "_id" : true,
                           "x" : true
                   }
           },
           {
                   "$sort" : {
                           "sortKey" : {
                                   "_id" : 1
                           }
                   }
           },
           {
                   "$project" : {
                           "_id" : true,
                           "x" : true
                   }
           }
   ],
   "serverInfo" : {
           "host" : "ip-10-122-10-73",
           "port" : 20000,
           "version" : "0.0.0",
           "gitVersion" : "unknown"
   },
   "command" : {
           "aggregate" : "system.buckets.t_1",
           "pipeline" : [
                   {
                           "$_internalUnpackBucket" : {
                                   "timeField" : "time",
                                   "exclude" : [ ]
                           }
                   },
                   {
                           "$sort" : {
                                   "_id" : 1
                           }
                   },
                   {
                           "$project" : {
                                   "x" : 1
                           }
                   }
           ],
           "cursor" : {
           },
           "collation" : {
                   "locale" : "simple"
           }
   },
   "ok" : 1
 }

I suspect this may be an issue with the CST parser as it's only failing in the cst_jscore_passthrough suite for the all feature flags variant. I wonder if removing the _id index table on time-series collections triggered some unexpected behaviour.



 Comments   
Comment by Charlie Swanson [ 09/Feb/21 ]

Oops, re-opening this ticket to stick it on the backlog since I was hit with SERVER-54428 for an outstanding TODO. I think the TODO still makes sense and can be addressed separately, the suite remains and is just not being run on evergreen. 

I'll re-purpose this ticket to track the work to fix the test in this suite when we resume the project.

Comment by Charlie Swanson [ 09/Feb/21 ]

Fixed the linked ticket. I'm closing this as "Gone Away" - maybe the link will someday be useful if/when we revive the CST project.

Comment by Charlie Swanson [ 26/Jan/21 ]

Sorry about that gregory.wlodarek. We actually intend to turn off or delete this suite until we get back to the CST. That work is tracked in SERVER-53746 so I'll mark this as depending on that. I think we hope to close that one on Thursday or Friday - stay tuned.

Generated at Thu Feb 08 05:32:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.