[SERVER-82287] jstests/noPassthroughWithMongod/timeseries_match_pushdown_with_project.js fails agains classic engine with all feature flags Created: 18/Oct/23  Updated: 11/Jan/24  Resolved: 20/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Alexander Ignatyev Assignee: Irina Yatsenko (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Fix
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

resmoke run --runAllFeatureFlagTests jstests/noPassthroughWithMongod/timeseries_match_pushdown_with_project.js

Sprint: QE 2023-10-30
Participants:
Linked BF Score: 5

 Description   

2023-10-18T12:27:44.888Z assert: [1] != [0] are not equal : Should only have a single UNPACK_TS_BUCKET stage: {
    "explainVersion" : "1",
    "stages" : [
        {
            "$cursor" : {
                "queryPlanner" : {
                    "namespace" : "test.system.buckets.timeseries_match_pushdown_with_project",
                    "indexFilterSet" : false,
                    "parsedQuery" : {
                        "control.max.a" : {
                            "$_internalExprGt" : 5
                        }
                    },
                    "queryHash" : "B7829371",
                    "planCacheKey" : "B7829371",
                    "maxIndexedOrSolutionsReached" : false,
                    "maxIndexedAndSolutionsReached" : false,
                    "maxScansToExplodeReached" : false,
                    "winningPlan" : {
                        "stage" : "COLLSCAN",
                        "filter" : {
                            "control.max.a" : {
                                "$_internalExprGt" : 5
                            }
                        },
                        "direction" : "forward"
                    },
                    "rejectedPlans" : [ ]
                }
            }
        },
        {
            "$_internalUnpackBucket" : {
                "include" : [
                    "_id",
                    "a",
                    "b"
                ],
                "timeField" : "time",
                "metaField" : "meta",
                "bucketMaxSpanSeconds" : 3600,
                "assumeNoMixedSchemaData" : true,
                "eventFilter" : {
                    "a" : {
                        "$gt" : 5
                    }
                }
            }
        },
        {
            "$project" : {
                "_id" : true,
                "b" : true
            }
        }
    ],
    "serverInfo" : {
        "host" : "ip-10-128-50-239.ec2.internal",
        "port" : 20250,
        "version" : "7.2.0-alpha-688-g5f753b6-patch-652fbb2e850e616c005ae290",
        "gitVersion" : "5f753b64500373a5a36acefd4c9867a3aafc187c"
    },
    "serverParameters" : {
        "internalQueryFacetBufferSizeBytes" : 104857600,
        "internalQueryFacetMaxOutputDocSizeBytes" : 104857600,
        "internalLookupStageIntermediateDocumentMaxSizeBytes" : 104857600,
        "internalDocumentSourceGroupMaxMemoryBytes" : 104857600,
        "internalQueryMaxBlockingSortMemoryUsageBytes" : 104857600,
        "internalQueryProhibitBlockingMergeOnMongoS" : 0,
        "internalQueryMaxAddToSetBytes" : 104857600,
        "internalDocumentSourceSetWindowFieldsMaxMemoryBytes" : 104857600,
        "internalQueryFrameworkControl" : "forceClassicEngine"
    },
    "command" : {
        "aggregate" : "system.buckets.timeseries_match_pushdown_with_project",
        "pipeline" : [
            {
                "$_internalUnpackBucket" : {
"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn9","msg":"Connection ended","attr":\{"remote":"127.0.0.1:57360","uuid":{"uuid":,"connectionId":9,"connectionCount":0}}
                    "timeField" : "time",
                    "metaField" : "meta",
                    "bucketMaxSpanSeconds" : 3600,
                    "assumeNoMixedSchemaData" : true,
                    "usesExtendedRange" : false,
                    "fixedBuckets" : false
                }
            },
            {
                "$match" : {
                    "a" : {
                        "$gt" : 5
                    }
                }
            },
            {
                "$project" : {
                    "b" : 1
                }
            }
        ],
        "cursor" : {
 
        },
        "collation" : {
            "locale" : "simple"
        }
    },
    "ok" : 1
}
doassert@src/mongo/shell/assert.js:20:14
assert.eq@src/mongo/shell/assert.js:176:17
runTest/unpackStage<@jstests/noPassthroughWithMongod/timeseries_match_pushdown_with_project.js:44:20
runTest@jstests/noPassthroughWithMongod/timeseries_match_pushdown_with_project.js:55:7
@jstests/noPassthroughWithMongod/timeseries_match_pushdown_with_project.js:74:8

https://spruce.mongodb.com/task/mongodb_mongo_master_enterprise_rhel_80_64_bit_dynamic_classic_engine_all_feature_flags_required_query_patch_only_noPassthroughWithMongod_1_linux_enterprise_patch_5f753b64500373a5a36acefd4c9867a3aafc187c_652fbb2e850e616c005ae290_23_10_18_11_02_17/tests?execution=0&sortBy=STATUS&sortDir=ASC



 Comments   
Comment by Githook User [ 20/Oct/23 ]

Author:

{'name': 'Irina Yatsenko', 'email': 'irina.yatsenko@mongodb.com', 'username': 'IrinaYatsenko'}

Message: SERVER-82287 Replace a noPassthrough test with a core test that verifies lowering to SBE explicitly
Branch: master
https://github.com/mongodb/mongo/commit/ebda74969c3d8f4dd3d182be24a4823f85acdbd2

Comment by Irina Yatsenko (Inactive) [ 19/Oct/23 ]

It looks like the noPassthroughWithMongod was added to test that lowering of $_internalUnpackBucket stage to SBE does happen when the corresponding flags are on. However, the original test's intent was to validate pushdown of match + project over timeseries for whatever engine might be used. The core test has been updated to do exactly that. I'll add a test to explicitly sanity check lowering to SBE when the corresponding flags are set.

Comment by Irina Yatsenko (Inactive) [ 18/Oct/23 ]

I've missed that this ticket is about noPassthroughWithMongod\timeseries_match_pushdown_with_project.js. The above comment is for the core one.

Comment by Irina Yatsenko (Inactive) [ 18/Oct/23 ]

The test has been updated to be able to deal with running either in SBE or classic per f53a7118138 (for SERVER-80324). This is not and SBE-only test.

Comment by Alexander Ignatyev [ 18/Oct/23 ]

Potentially can be duplicated by SERVER-82254

Comment by Alexander Ignatyev [ 18/Oct/23 ]

cc: irina.yatsenko@mongodb.com 

Generated at Thu Feb 08 06:48:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.