ISSUE SUMMARY
A bug in the convertToCapped command causes the server to abort with an assertion failure if the collection does not exist.
USER IMPACT
Server defensively quits when hitting the assertion, which can affect replica set quorum and in the worst case availability of the replica set.
WORKAROUNDS
Check first if a collection exists before running the convertToCapped command.
AFFECTED VERSIONS
Versions 2.6.0 and 2.6.1 are affected by this issue.
FIX VERSION
The fix is included in the 2.6.2 production release.
RESOLUTION DETAILS
We now check if the collection exists before executing the command.
Original description
Run convertToCapped on empty collection:
db.runCommand({convertToCapped: 'a.a', size: 4096});
and mongod will abort
***aborting after invariant() failure 2014-04-25T21:22:02.844+0000 [conn11] SEVERE: Got signal: 6 (Aborted). Backtrace:0xf81006 0xf80de0 0x7fc6fa242920 0x7fc6fa2428a5 0x7fc6fa244085 0xf1802b 0xab9e2f 0x9077ab 0x905e7d 0x9b4174 0x9b5c25 0x9b645e 0xc4da55 0xac964e 0xace300 0x7bae2f 0xf3f189 0x7fc6fb59c851 0x7fc6fa2f76dd mongod(mongo::printStackTrace(std::basic_ostream<char, std::char_traits<char> >&)+0x26) [0xf81006] mongod() [0xf80de0] /lib64/libc.so.6(+0x32920) [0x7fc6fa242920] /lib64/libc.so.6(gsignal+0x35) [0x7fc6fa2428a5] /lib64/libc.so.6(abort+0x175) [0x7fc6fa244085] mongod(mongo::invariantFailed(char const*, char const*, unsigned int)+0x1eb) [0xf1802b] mongod() [0xab9e2f] mongod(mongo::CmdConvertToCapped::stopIndexBuilds(mongo::Database*, mongo::BSONObj const&)+0x10b) [0x9077ab] mongod(mongo::CmdConvertToCapped::run(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj&, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&, bool)+0x7d) [0x905e7d] mongod(mongo::_execCommand(mongo::Command*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj&, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&, bool)+0x34) [0x9b4174] mongod(mongo::Command::execCommand(mongo::Command*, mongo::Client&, int, char const*, mongo::BSONObj&, mongo::BSONObjBuilder&, bool)+0xfa5) [0x9b5c25] mongod(mongo::_runCommands(char const*, mongo::BSONObj&, mongo::_BufBuilder<mongo::TrivialAllocator>&, mongo::BSONObjBuilder&, bool, int)+0x2be) [0x9b645e] mongod(mongo::newRunQuery(mongo::Message&, mongo::QueryMessage&, mongo::CurOp&, mongo::Message&)+0xa55) [0xc4da55] mongod() [0xac964e] mongod(mongo::assembleResponse(mongo::Message&, mongo::DbResponse&, mongo::HostAndPort const&)+0x4b0) [0xace300] mongod(mongo::MyMessageHandler::process(mongo::Message&, mongo::AbstractMessagingPort*, mongo::LastError*)+0xef) [0x7bae2f] mongod(mongo::PortMessageServer::handleIncomingMsg(void*)+0x5a9) [0xf3f189] /lib64/libpthread.so.0(+0x7851) [0x7fc6fb59c851] /lib64/libc.so.6(clone+0x6d) [0x7fc6fa2f76dd]
(via mongod-user list)
- is related to
-
SERVER-15282 Collection is not replicated to the secondary if the collection is created by adding the index on _id field
- Closed