Skip to content

Commit 3e6190b

Browse files
authored
chore(mongodb-explain-compat): add 7.2 mongos unsharded collection explain COMPASS-7603 (#5398)
It doesn't look like code changes are necessary for us, so just adding example data as a test case here should be enough for this ticket.
1 parent 9e100e0 commit 3e6190b

File tree

3 files changed

+232
-0
lines changed

3 files changed

+232
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"serverInfo": {
3+
"host": "M-C02D23CNMD6R",
4+
"port": 27017,
5+
"version": "7.3.0-alpha1-184-gef22b28",
6+
"gitVersion": "ef22b2853f29e36ff86c78e8f3d5627508252826"
7+
},
8+
"serverParameters": {
9+
"internalQueryFacetBufferSizeBytes": 104857600,
10+
"internalQueryFacetMaxOutputDocSizeBytes": 104857600,
11+
"internalLookupStageIntermediateDocumentMaxSizeBytes": 104857600,
12+
"internalDocumentSourceGroupMaxMemoryBytes": 104857600,
13+
"internalQueryMaxBlockingSortMemoryUsageBytes": 104857600,
14+
"internalQueryProhibitBlockingMergeOnMongoS": 0,
15+
"internalQueryMaxAddToSetBytes": 104857600,
16+
"internalDocumentSourceSetWindowFieldsMaxMemoryBytes": 104857600,
17+
"internalQueryFrameworkControl": "trySbeRestricted"
18+
},
19+
"splitPipeline": null,
20+
"shards": {
21+
"replSet-a3becde9-cc49-4b7d-94c8-266bc36068ef": {
22+
"host": "127.0.0.1:64745",
23+
"stages": [
24+
{
25+
"$cursor": {
26+
"queryPlanner": {
27+
"namespace": "test.coll",
28+
"indexFilterSet": false,
29+
"parsedQuery": {},
30+
"queryHash": "E0087D7B",
31+
"planCacheKey": "2FE566FB",
32+
"optimizationTimeMillis": 0,
33+
"maxIndexedOrSolutionsReached": false,
34+
"maxIndexedAndSolutionsReached": false,
35+
"maxScansToExplodeReached": false,
36+
"winningPlan": {
37+
"isCached": false,
38+
"stage": "PROJECTION_SIMPLE",
39+
"transformBy": {
40+
"_id": true,
41+
"author": true,
42+
"tags": true
43+
},
44+
"inputStage": {
45+
"stage": "COLLSCAN",
46+
"direction": "forward"
47+
}
48+
},
49+
"rejectedPlans": []
50+
}
51+
}
52+
},
53+
{
54+
"$unwind": {
55+
"path": "$tags"
56+
}
57+
},
58+
{
59+
"$group": {
60+
"_id": {
61+
"tags": "$tags"
62+
},
63+
"authors": {
64+
"$addToSet": "$author"
65+
}
66+
}
67+
}
68+
]
69+
}
70+
},
71+
"command": {
72+
"aggregate": "coll",
73+
"pipeline": [
74+
{
75+
"$project": {
76+
"author": 1,
77+
"tags": 1
78+
}
79+
},
80+
{
81+
"$unwind": "$tags"
82+
},
83+
{
84+
"$group": {
85+
"_id": {
86+
"tags": "$tags"
87+
},
88+
"authors": {
89+
"$addToSet": "$author"
90+
}
91+
}
92+
}
93+
],
94+
"cursor": {}
95+
},
96+
"ok": 1,
97+
"$clusterTime": {
98+
"clusterTime": {
99+
"$timestamp": "7329888704586055681"
100+
},
101+
"signature": {
102+
"hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
103+
"keyId": {
104+
"low": 0,
105+
"high": 0,
106+
"unsigned": false
107+
}
108+
}
109+
},
110+
"operationTime": {
111+
"$timestamp": "7329888691701153793"
112+
}
113+
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"serverInfo": {
3+
"host": "M-C02D23CNMD6R",
4+
"port": 27017,
5+
"version": "7.3.0-alpha1-184-gef22b28",
6+
"gitVersion": "ef22b2853f29e36ff86c78e8f3d5627508252826"
7+
},
8+
"serverParameters": {
9+
"internalQueryFacetBufferSizeBytes": 104857600,
10+
"internalQueryFacetMaxOutputDocSizeBytes": 104857600,
11+
"internalLookupStageIntermediateDocumentMaxSizeBytes": 104857600,
12+
"internalDocumentSourceGroupMaxMemoryBytes": 104857600,
13+
"internalQueryMaxBlockingSortMemoryUsageBytes": 104857600,
14+
"internalQueryProhibitBlockingMergeOnMongoS": 0,
15+
"internalQueryMaxAddToSetBytes": 104857600,
16+
"internalDocumentSourceSetWindowFieldsMaxMemoryBytes": 104857600,
17+
"internalQueryFrameworkControl": "trySbeRestricted"
18+
},
19+
"splitPipeline": null,
20+
"shards": {
21+
"replSet-a3becde9-cc49-4b7d-94c8-266bc36068ef": {
22+
"host": "127.0.0.1:64745",
23+
"stages": [
24+
{
25+
"$cursor": {
26+
"queryPlanner": {
27+
"namespace": "test.coll",
28+
"indexFilterSet": false,
29+
"parsedQuery": {},
30+
"queryHash": "E0087D7B",
31+
"planCacheKey": "2FE566FB",
32+
"optimizationTimeMillis": 0,
33+
"maxIndexedOrSolutionsReached": false,
34+
"maxIndexedAndSolutionsReached": false,
35+
"maxScansToExplodeReached": false,
36+
"winningPlan": {
37+
"isCached": false,
38+
"stage": "PROJECTION_SIMPLE",
39+
"transformBy": {
40+
"_id": true,
41+
"author": true,
42+
"tags": true
43+
},
44+
"inputStage": {
45+
"stage": "COLLSCAN",
46+
"direction": "forward"
47+
}
48+
},
49+
"rejectedPlans": []
50+
}
51+
}
52+
},
53+
{
54+
"$unwind": {
55+
"path": "$tags"
56+
}
57+
},
58+
{
59+
"$group": {
60+
"_id": {
61+
"tags": "$tags"
62+
},
63+
"authors": {
64+
"$addToSet": "$author"
65+
}
66+
}
67+
}
68+
]
69+
}
70+
},
71+
"command": {
72+
"aggregate": "coll",
73+
"pipeline": [
74+
{
75+
"$project": {
76+
"author": 1,
77+
"tags": 1
78+
}
79+
},
80+
{
81+
"$unwind": "$tags"
82+
},
83+
{
84+
"$group": {
85+
"_id": {
86+
"tags": "$tags"
87+
},
88+
"authors": {
89+
"$addToSet": "$author"
90+
}
91+
}
92+
}
93+
],
94+
"cursor": {}
95+
},
96+
"ok": 1,
97+
"$clusterTime": {
98+
"clusterTime": {
99+
"$timestamp": "7329888704586055681"
100+
},
101+
"signature": {
102+
"hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
103+
"keyId": {
104+
"low": 0,
105+
"high": 0,
106+
"unsigned": false
107+
}
108+
}
109+
},
110+
"operationTime": {
111+
"$timestamp": "7329888691701153793"
112+
}
113+
}

packages/mongodb-explain-compat/test/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ describe('convertExplainCompat', () => {
105105
fixture('unsharded-find.sbe.out')
106106
);
107107
});
108+
it('handles 7.2 (SERVER-79724) changes to mongos explain for unsharded collections', () => {
109+
assert.deepStrictEqual(
110+
convertExplainCompat(fixture('unsharded-aggregate-on-mongos.7.2.in')),
111+
fixture('unsharded-aggregate-on-mongos.7.2.out')
112+
);
113+
});
108114
});
109115

110116
describe('explain mode "queryPlanner"', function () {

0 commit comments

Comments
 (0)