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

Sharded find command fails with "undefined slot accessor" when SBE is on

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • v5.0
    • Query Execution 2021-05-31
    • 47

      The query_fuzzer_sharded picked up on this. I haven't figured out exactly what the problem is yet, but here is a simple repro:

      (function() {
      "use strict";
      
      const st = new ShardingTest({shards: 1});
      const db = st.s.getDB("test");
      
      const shardKey = {
          num: 1,
          "obj.str": "hashed"
      };
      
      assert.commandWorked(db.createCollection("c"));
      const coll = db.c;
      assert.commandWorked(coll.createIndex(shardKey));
      
      assert.commandWorked(db.adminCommand({enableSharding: "test"}));
      assert.commandWorked(db.adminCommand({
          shardCollection: coll.getFullName(),
          key: shardKey,
      }));
      
      assert.eq([], coll.find({num: {$in: [/myRegex/, 1]}}).sort({"obj.obj.obj": 1}).toArray());
      
      st.stop();
      }());
      

      Note that although this is an "undefined slot accessor" error which can happen in the query fuzzer, it looks like a separate issue from SERVER-56506.

      One thing I noticed is that this does not repro unless the $in match expression has a regular expression as one of its arguments. Perhaps some special code in the SBE stage builders for $in with a regex plays badly with how we construct the plan for shard filtering? Just guessing based on the nature of the repro.

            Assignee:
            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: