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

sharded aggregation explain failure

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • ALL

      I got the following assertion when trying to do a sharded explain:

       m30999| Wed Jun 20 11:00:27 [conn]   Assertion failure pSourceBsonArray src/mongo/db/commands/pipeline.cpp 480
       m30999| 0x103538fd5 0x10326a29b 0x1033e8fa9 0x10352d656 0x10352e149 0x103368098 0x10336a093 0x103349df4 0x1033bf5cb 0x1034311f1 0x103190f83 0x10380a99e 0x10380c0a0 0x10380c102 0x10380c12d 0x10359d149 0x1047f58bf 0x1047f8b75 
       m30999|  0   mongos                              0x0000000103538fd5 _ZN5mongo15printStackTraceERSo + 37
       m30999|  1   mongos                              0x000000010326a29b _ZN5mongo10logContextEPKc + 123
       m30999|  2   mongos                              0x00000001033e8fa9 _ZN5mongo12verifyFailedEPKcS1_j + 409
       m30999|  3   mongos                              0x000000010352d656 _ZNK5mongo8Pipeline18writeExplainMongosERNS_14BSONObjBuilderERKN5boost13intrusive_ptrINS_14DocumentSourceEEE + 206
       m30999|  4   mongos                              0x000000010352e149 _ZN5mongo8Pipeline3runERNS_14BSONObjBuilderERSsRKN5boost13intrusive_ptrINS_14DocumentSourceEEE + 1217
       m30999|  5   mongos                              0x0000000103368098 _ZN5mongo15dbgrid_pub_cmds15PipelineCommand3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 3624
       m30999|  6   mongos                              0x000000010336a093 _ZN5mongo7Command20runAgainstRegisteredEPKcRNS_7BSONObjERNS_14BSONObjBuilderEi + 3329
       m30999|  7   mongos                              0x0000000103349df4 _ZN5mongo14SingleStrategy7queryOpERNS_7RequestE + 1230
       m30999|  8   mongos                              0x00000001033bf5cb _ZN5mongo13ShardStrategy7queryOpERNS_7RequestE + 99
       m30999|  9   mongos                              0x00000001034311f1 _ZN5mongo7Request7processEi + 595
       m30999|  10  mongos                              0x0000000103190f83 _ZN5mongo21ShardedMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 243
       m30999|  11  mongos                              0x000000010380a99e _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1630
       m30999|  12  mongos                              0x000000010380c0a0 _ZN5boost3_bi5list1INS0_5valueIPN5mongo13MessagingPortEEEEclIPFvS5_ENS0_5list0EEEvNS0_4typeIvEERT_RT0_i + 78
       m30999|  13  mongos                              0x000000010380c102 _ZN5boost3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS0_5list1INS0_5valueIS4_EEEEEclEv + 92
       m30999|  14  mongos                              0x000000010380c12d _ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS2_5list1INS2_5valueIS6_EEEEEEE3runEv + 37
       m30999|  15  mongos                              0x000000010359d149 thread_proxy + 169
       m30999|  16  libsystem_c.dylib                   0x00000001047f58bf _pthread_start + 335
       m30999|  17  libsystem_c.dylib                   0x00000001047f8b75 thread_start + 13
       m30999| Wed Jun 20 11:00:27 [conn] sharded connection to localhost:30001 not being returned to the pool
      {
      	"errmsg" : "exception: assertion src/mongo/db/commands/pipeline.cpp:480",
      	"code" : 0,
      	"ok" : 0
      }
      
      // Set up a sharding test.
      s = new ShardingTest( "test", 2, 0, 2 );
      s.adminCommand( { enablesharding:"test" } );
      // Shard the collection.
      s.adminCommand( { shardcollection:"test.data", key:{ _id:1 } } );
      
      db = s.getDB( "test" );
      
      // Insert some data.
      N = 100;
      for( i = 0; i < N; ++i ) {
          db.data.insert( { _id:i } )
      }
      db.getLastError();
      
      // Try to run a sharded aggregation.
      result = db.data.runCommand( "aggregate" , { pipeline : [{ $project: { a:1 } }], explain:true } );
      printjson( result );
      

      Observed behavior: An attempt to explain a sharded aggregation triggers an assertion.
      Expected behavior: An attempt to explain a sharded aggregation produces explanatory output.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: