[SERVER-6140] sharded aggregation explain failure Created: 20/Jun/12  Updated: 11/Jul/16  Resolved: 07/Oct/13

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-4504 aggregation: need an explain facility Closed
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by auto [ 07/Oct/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-6140 Add a basic sharded agg explain test
Branch: master
https://github.com/mongodb/mongo/commit/eb09362ff4996de88dab11b782d2e52413405495

Comment by auto [ 20/Sep/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-4504 explain for aggregation

This is just the infrastucture change. Each DocumentSource will need to
have it's serialize()/serializeToArray() implementation examined and
improved.

Related tickets:
SERVER-6140 A specific failure in the old impl of explain.
Branch: master
https://github.com/mongodb/mongo/commit/755e7956642c01d2ba6ae7cf184b0f1a8aa0eab1

Generated at Thu Feb 08 03:10:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.