[SERVER-5965] mongos crashes with signal 8 when attempting to shardCollection with a huge chunkSize setting Created: 30/May/12  Updated: 11/Jul/16  Resolved: 17/Jan/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.1.1
Fix Version/s: 2.4.0-rc0

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: crash, mongos, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File crash.js    
Operating System: ALL
Participants:

 Description   

git commit hash: 62db9a328c30f497960fd10b7be2f34990dcdbd3

 m30999| Wed May 30 15:47:14 [conn1] CMD: shardcollection: { shardCollection: "test.user", key: { x: 1.0 } }
 m30999| Wed May 30 15:47:14 [conn1] enable sharding on: test.user with shard key: { x: 1.0 }
 m30999| Received signal 8
 m30999| Backtrace: 0x6a0810 0x7f2763d234c0 0x7df871 0x7e0396 0x7ed5d0 0x7eddc0 0x66d82d 0x521b49 0x52629f 0x514552 0x50a8bb 0x53c82c 0x548942 0x76c9d5 0x7f27648c1e9a 0x7f2763ddf4bd 
 m30999| /home/ren/mongo/mongos(_ZN5mongo17printStackAndExitEi+0x60)[0x6a0810]
 m30999| /lib/x86_64-linux-gnu/libc.so.6(+0x364c0)[0x7f2763d234c0]
 m30999| /home/ren/mongo/mongos(_ZN5mongo5Chunk13mkDataWrittenEv+0x31)[0x7df871]
 m30999| /home/ren/mongo/mongos(_ZN5mongo5ChunkC1EPKNS_12ChunkManagerERKNS_7BSONObjES6_RKNS_5ShardENS_17ShardChunkVersionE+0x86)[0x7e0396]
 m30999| /home/ren/mongo/mongos(_ZNK5mongo12ChunkManager23calcInitSplitsAndShardsERKNS_5ShardEPKSt6vectorINS_7BSONObjESaIS5_EEPKS4_IS1_SaIS1_EEPS7_PSB_+0xe0)[0x7ed5d0]
 m30999| /home/ren/mongo/mongos(_ZN5mongo12ChunkManager17createFirstChunksERKSsRKNS_5ShardEPKSt6vectorINS_7BSONObjESaIS7_EEPKS6_IS3_SaIS3_EE+0x90)[0x7eddc0]
 m30999| /home/ren/mongo/mongos(_ZN5mongo8DBConfig15shardCollectionERKSsNS_15ShardKeyPatternEbPSt6vectorINS_7BSONObjESaIS5_EEPS4_INS_5ShardESaIS9_EE+0x17d)[0x66d82d]
 m30999| /home/ren/mongo/mongos(_ZN5mongo11dbgrid_cmds18ShardCollectionCmd3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x1349)[0x521b49]
 m30999| /home/ren/mongo/mongos(_ZN5mongo7Command20runAgainstRegisteredEPKcRNS_7BSONObjERNS_14BSONObjBuilderEi+0x85f)[0x52629f]
 m30999| /home/ren/mongo/mongos(_ZN5mongo14SingleStrategy7queryOpERNS_7RequestE+0x2b2)[0x514552]
 m30999| /home/ren/mongo/mongos(_ZN5mongo13ShardStrategy7queryOpERNS_7RequestE+0x53b)[0x50a8bb]
 m30999| /home/ren/mongo/mongos(_ZN5mongo7Request7processEi+0x15c)[0x53c82c]
 m30999| /home/ren/mongo/mongos(_ZN5mongo21ShardedMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x72)[0x548942]
 m30999| /home/ren/mongo/mongos(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x2c5)[0x76c9d5]
 m30999| /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7f27648c1e9a]
 m30999| /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f2763ddf4bd]
 m30999| ===
Wed May 30 15:47:14 DBClientCursor::init call() failed
Wed May 30 15:47:14 query failed : admin.$cmd { shardCollection: "test.user", key: { x: 1.0 } } to: 127.0.0.1:30999

output with addr2line:

formattedBacktrace
/home/ren/mongo/src/mongo/util/signal_handlers.cpp:94
??
??:0
mongo::Chunk::mkDataWritten()
/home/ren/mongo/src/mongo/s/chunk.cpp:83
Chunk
/home/ren/mongo/src/mongo/s/chunk.cpp:79
mongo::ChunkManager::calcInitSplitsAndShards(mongo::Shard const&, std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> > const*, std::vector<mongo::Shard, std::allocator<mongo::Shard> > const*, std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> >*, std::vector<mongo::Shard, std::allocator<mongo::Shard> >*) const
/home/ren/mongo/src/mongo/s/chunk.cpp:916
mongo::OID::gen()
/home/ren/mongo/src/mongo/db/../bson/oid.h:64
mongo::DBConfig::shardCollection(std::string const&, mongo::ShardKeyPattern, bool, std::vector<mongo::BSONObj, std::allocator<mongo::BSONObj> >*, std::vector<mongo::Shard, std::allocator<mongo::Shard> >*)
/home/ren/mongo/src/mongo/s/config.cpp:167
~shared_ptr
/home/ren/mongo/src/third_party/boost/boost/smart_ptr/shared_ptr.hpp:164
mongo::Command::runAgainstRegistered(char const*, mongo::BSONObj&, mongo::BSONObjBuilder&, int)
/home/ren/mongo/src/mongo/s/commands_public.cpp:1602
mongo::SingleStrategy::queryOp(mongo::Request&)
/home/ren/mongo/src/mongo/s/strategy_single.cpp:59
mongo::ShardStrategy::queryOp(mongo::Request&)
/home/ren/mongo/src/mongo/s/strategy_shard.cpp:109
mongo::Request::process(int)
/home/ren/mongo/src/mongo/s/request.cpp:129
~shared_ptr
/home/ren/mongo/src/third_party/boost/boost/smart_ptr/shared_ptr.hpp:164
mongo::pms::threadRun(mongo::MessagingPort*)
/home/ren/mongo/src/mongo/util/net/message_server_port.cpp:211
??
??:0
??
??:0
 



 Comments   
Comment by auto [ 18/Jan/13 ]

Author:

{u'date': u'2013-01-18T15:49:19Z', u'email': u'milkie@10gen.com', u'name': u'Eric Milkie'}

Message: SERVER-5965 fix unit test
Branch: master
https://github.com/mongodb/mongo/commit/123a10609e275a46b55e8f8a12c7b9d37217f4b4

Comment by auto [ 17/Jan/13 ]

Author:

{u'date': u'2013-01-17T19:48:21Z', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}

Message: SERVER-5965: don't let users say too large chunk sizes
Branch: master
https://github.com/mongodb/mongo/commit/e39b2d1781b23be7d218b5acde55843ac4cda80b

Comment by Randolph Tan [ 30/May/12 ]

Attached a simple test that can replicate this 100%.

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