-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We hit this tassert when we yield during sampling for a join-opt query:
// code placeholdersdfdf /** * Tests that join optimization * @tags: [ * requires_fcv_83, * requires_sbe * ] */ import {configureFailPoint} from "jstests/libs/fail_point_util.js"; import {funWithArgs} from "jstests/libs/parallel_shell_helpers.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB(jsTestName()); assert.commandWorked(conn.adminCommand({setParameter: 1, internalEnableJoinOptimization: true})); assert(db.coll.drop()); assert(db.foreign.drop()); assert.commandWorked(db.coll.insert( Array.from({length:1000}, (_, i) => ({_id:i, a:i, b:i})))); assert.commandWorked(db.foreign.insert( Array.from({length:1000}, (_, i) => ({_id:i, a:i, b:i})))); assert.commandWorked(db.coll.createIndex({a: 1}, {name: "a_index"})); // This is the index you want to become multikey. assert.commandWorked(db.foreign.createIndex({b: 1}, {name: "b_index"})); // Force frequent yields. assert.commandWorked( db.adminCommand({setParameter:1, internalQueryExecYieldIterations:1})); // Hang all yields for this namespace while the pipeline runs. let fp = configureFailPoint(conn, "setYieldAllLocksHang", {namespace: db.coll.getFullName()}); let awaitShell = startParallelShell( funWithArgs(function (dbName, collName) { constpipeline= [ {$match: {a: {$gte: 0}, b: {$gte: 0}}}, { $lookup: { from:"foreign", localField:"a", foreignField:"b", as:"out", } }, {$unwind: "$out"}, {$project: {_id: 0, a: 1, "out.b": 1}}, ]; db.getSiblingDB(dbName)[collName].aggregate(pipeline).toArray(); }, db.getName(), db.coll.getName()), conn.port); // Wait for the aggregation to hit the yield failpoint. fp.wait(); // While the join plan is pinned and yielded, make the foreign index multikey. assert.commandWorked(db.foreign.insert({a: 9999, b: [9999, 10000]})); assert.commandWorked(db.coll.insert({a: [9999, 10000], b: 9999})); // Let the aggregation resume and finish under a now-multikey index. fp.off(); try { awaitShell(); } catch (exception){ printjson(exception) } MongoRunner.stopMongod(conn);