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

Invariant failure when running explained update against config or admin db in sharded cluster

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.1.4
    • Component/s: Sharding
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      var st = new ShardingTest({});
      var myDB = st.s0.getDB('admin'); // 'config' also causes an invariant failure
       
      myDB.runCommand({explain: {update: 'z', updates: [{q: {}, u: {a: 1}}]}});
      

      Show
      var st = new ShardingTest({}); var myDB = st.s0.getDB('admin'); // 'config' also causes an invariant failure   myDB.runCommand({explain: {update: 'z', updates: [{q: {}, u: {a: 1}}]}});

      Description

      In 3.0.3, explained updates against the 'config' and 'admin' databases return explain plans.

      In newer 3.1.x versions, the explained updates cause invariant failures because there's no shard information for the 'config' and 'admin' databases.

      Invariant failure shard src/mongo/s/client/shard.cpp 120
       
      #0  0x00007fb841f6920b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
      #1  0x0000000000fd06b4 in mongo::breakpoint () at src/mongo/util/debugger.cpp:57
      #2  0x0000000000fc2e49 in mongo::invariantFailed (expr=0x11ef5ad "shard", file=0x11ef582 "src/mongo/s/client/shard.cpp", line=120) at src/mongo/util/assert_util.cpp:153
      #3  0x0000000000f08251 in mongo::Shard::reset (this=0x7fb8404b90b0, ident=...) at src/mongo/s/client/shard.cpp:120
      #4  0x0000000000e71908 in mongo::Shard::make (ident=...) at src/mongo/s/client/shard.h:82
      #5  0x0000000000f7cda9 in mongo::Strategy::commandOpWrite (this=0x1e18210, dbName=..., command=..., targetingBatchItem=..., results=0x7fb8404b9370) at src/mongo/s/strategy.cpp:481
      #6  0x0000000000f47a5f in mongo::(anonymous namespace)::ClusterWriteCmd::explain (this=0x1740720 <mongo::(anonymous namespace)::clusterUpdateCmd>, txn=0x0, dbname=..., cmdObj=..., verbosity=mongo::ExplainCommon::EXEC_ALL_PLANS, 
          out=0x7fb8404b9930) at src/mongo/s/commands/cluster_write_cmd.cpp:129
      #7  0x0000000000f20115 in mongo::ClusterExplainCmd::run (this=0x173ef20 <mongo::cmdExplainCluster>, txn=0x0, dbName=..., cmdObj=..., options=0, errmsg=..., result=...) at src/mongo/s/commands/cluster_explain_cmd.cpp:120
      #8  0x0000000000f731fe in mongo::Command::execCommandClientBasic (txn=0x0, c=0x173ef20 <mongo::cmdExplainCluster>, client=..., queryOptions=0, ns=0x7fb8140717f4 "admin.$cmd", cmdObj=..., result=...) at src/mongo/s/s_only.cpp:128
      #9  0x0000000000f73678 in mongo::Command::runAgainstRegistered (ns=0x7fb8140717f4 "admin.$cmd", jsobj=..., anObjBuilder=..., queryOptions=0) at src/mongo/s/s_only.cpp:172
      #10 0x0000000000f7b908 in mongo::Strategy::clientCommandOp (this=0x1e18210, r=...) at src/mongo/s/strategy.cpp:308
      #11 0x0000000000f72304 in mongo::Request::process (this=0x7fb8404b9bd0, attempt=0) at src/mongo/s/request.cpp:121
      #12 0x0000000000b3eab0 in mongo::ShardedMessageHandler::process (this=0x7fffbabafaa0, m=..., p=0x1e6dcc0) at src/mongo/s/server.cpp:141
      #13 0x0000000000fe3acd in mongo::PortMessageServer::handleIncomingMsg (arg=0x1e6dcc0) at src/mongo/util/net/message_server_port.cpp:227
      #14 0x00007fb841f61182 in start_thread (arg=0x7fb8404ba700) at pthread_create.c:312
      #15 0x00007fb841c8e47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: