Skip to content

Instantly share code, notes, and snippets.

@aht
Created January 17, 2013 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aht/4555130 to your computer and use it in GitHub Desktop.
Save aht/4555130 to your computer and use it in GitHub Desktop.
$centerSphere query hangs mongodb
> db['similar_items.tanhxdiv5ratings_cosinesimilarities.6'].count()
27745186
> db['similar_items.tanhxdiv5ratings_cosinesimilarities.6'].getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "osapi_int.similar_items.tanhxdiv5ratings_cosinesimilarities.6",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"p1" : 1
},
"ns" : "osapi_int.similar_items.tanhxdiv5ratings_cosinesimilarities.6",
"name" : "p1_1"
},
{
"v" : 1,
"key" : {
"p1" : 1,
"p2" : 1
},
"ns" : "osapi_int.similar_items.tanhxdiv5ratings_cosinesimilarities.6",
"name" : "p1_1_p2_1"
},
{
"v" : 1,
"key" : {
"xy" : "2d"
},
"ns" : "osapi_int.similar_items.tanhxdiv5ratings_cosinesimilarities.6",
"name" : "xy_2d"
}
]
{
"inprog" : [
{
"opid" : 14035479,
"active" : true,
"secs_running" : 210,
"op" : "query",
"ns" : "osapi_int.similar_items.tanhxdiv5ratings_cosinesimilarities.6",
"query" : {
"query" : {
"xy" : {
"$within" : {
"$centerSphere" : [
[
-122.3907852172852,
37.78129802378191
],
0.00005
]
}
}
},
"$explain" : true
},
"client" : "127.0.0.1:47221",
"desc" : "conn2484",
"threadId" : "0x7fcb73575700",
"connectionId" : 2484,
"locks" : {
"^" : "r",
"^osapi_int" : "R"
},
"waitingForLock" : false,
"numYields" : 0,
"lockStats" : {
"timeLockedMicros" : {
},
"timeAcquiringMicros" : {
"r" : NumberLong(6),
"w" : NumberLong(0)
}
}
},
{
"opid" : 14035482,
"active" : true,
"secs_running" : 204,
"op" : "query",
"ns" : "",
"query" : {
"serverStatus" : 1
},
"client" : "127.0.0.1:47225",
"desc" : "conn2488",
"threadId" : "0x7fcdb52d7700",
"connectionId" : 2488,
"locks" : {
"^" : "r"
},
"waitingForLock" : true,
"numYields" : 0,
"lockStats" : {
"timeLockedMicros" : {
},
"timeAcquiringMicros" : {
}
}
},
]
(gdb) thread apply all bt
Thread 16 (Thread 0x7fdeb1de7700 (LWP 1072)):
#0 0x00007fdeb44d59f7 in do_sigwait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007fdeb44d5a79 in sigwait () from /lib/x86_64-linux-gnu/libpthread.so.0
#2 0x0000000000557b98 in mongo::interruptThread() ()
#3 0x00000000007c3659 in ?? ()
#4 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#5 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x0000000000000000 in ?? ()
Thread 15 (Thread 0x7fdeb15e5700 (LWP 1074)):
#0 0x00007fdeb44d552d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x0000000000c0f312 in mongo::sleepmicros(long long) ()
#2 0x00000000005787f4 in mongo::DataFileSync::run() ()
#3 0x0000000000595fce in mongo::BackgroundJob::jobBody(boost::shared_ptr<mongo::BackgroundJob::JobStatus>) ()
#4 0x0000000000597a84 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, mongo::BackgroundJob, boost::shared_ptr<mongo::BackgroundJob::JobStatus> >, boost::_bi::list2<boost::_bi::value<mongo::BackgroundJob*>, boost::_bi::value<boost::shared_ptr<mongo::BackgroundJob::JobStatus> > > > >::run() ()
#5 0x00000000007c3659 in ?? ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 14 (Thread 0x7fdeb0de4700 (LWP 1085)):
#0 0x00007fdeb44d1d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000061c30b in void boost::condition_variable_any::wait<boost::unique_lock<boost::timed_mutex> >(boost::unique_lock<boost::timed_mutex>&) ()
#2 0x0000000000a8b6e9 in mongo::FileAllocator::run(mongo::FileAllocator*) ()
#3 0x00000000007c3659 in ?? ()
#4 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#5 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x0000000000000000 in ?? ()
Thread 13 (Thread 0x7fdeb05e3700 (LWP 1087)):
#0 0x00007fdeb44d1d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000007db28b in void boost::condition_variable_any::wait<boost::mutex>(boost::mutex&) ()
#2 0x0000000000adbd7f in mongo::Lock::GlobalWrite::GlobalWrite(bool, int) ()
#3 0x0000000000a0a6fc in ?? ()
#4 0x0000000000a0ae24 in mongo::dur::durThread() ()
#5 0x00000000007c3659 in ?? ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
---Type <return> to continue, or q <return> to quit---
Thread 12 (Thread 0x7fdeafde2700 (LWP 1236)):
#0 0x00007fdeb44d552d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x0000000000c0f88e in mongo::sleepsecs(int) ()
#2 0x000000000061192d in mongo::SnapshotThread::run() ()
#3 0x0000000000595fce in mongo::BackgroundJob::jobBody(boost::shared_ptr<mongo::BackgroundJob::JobStatus>) ()
#4 0x0000000000597a84 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, mongo::BackgroundJob, boost::shared_ptr<mongo::BackgroundJob::JobStatus> >, boost::_bi::list2<boost::_bi::value<mongo::BackgroundJob*>, boost::_bi::value<boost::shared_ptr<mongo::BackgroundJob::JobStatus> > > > >::run() ()
#5 0x00000000007c3659 in ?? ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 11 (Thread 0x7fdeaf5e1700 (LWP 1237)):
#0 0x00007fdeb44d552d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x0000000000c0f88e in mongo::sleepsecs(int) ()
#2 0x000000000069ddf4 in mongo::ClientCursorMonitor::run() ()
#3 0x0000000000595fce in mongo::BackgroundJob::jobBody(boost::shared_ptr<mongo::BackgroundJob::JobStatus>) ()
#4 0x0000000000597a84 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, mongo::BackgroundJob, boost::shared_ptr<mongo::BackgroundJob::JobStatus> >, boost::_bi::list2<boost::_bi::value<mongo::BackgroundJob*>, boost::_bi::value<boost::shared_ptr<mongo::BackgroundJob::JobStatus> > > > >::run() ()
#5 0x00000000007c3659 in ?? ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 10 (Thread 0x7fdeaede0700 (LWP 1238)):
#0 0x00007fdeb44d552d in nanosleep () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x0000000000c0f88e in mongo::sleepsecs(int) ()
#2 0x0000000000594b6b in mongo::PeriodicTask::Runner::run() ()
#3 0x0000000000595fce in mongo::BackgroundJob::jobBody(boost::shared_ptr<mongo::BackgroundJob::JobStatus>) ()
#4 0x0000000000597a84 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, mongo::BackgroundJob, boost::shared_ptr<mongo::BackgroundJob::JobStatus> >, boost::_bi::list2<boost::_bi::value<mongo::BackgroundJob*>, boost::_bi::value<boost::shared_ptr<mongo::BackgroundJob::JobStatus> > > > >::run() ()
#5 0x00000000007c3659 in ?? ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 9 (Thread 0x7fdeae5df700 (LWP 1239)):
#0 0x00007fdeb44d1d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000007db28b in void boost::condition_variable_any::wait<boost::mutex>(boost::mutex&) ()
#2 0x0000000000ad8f1c in mongo::Lock::DBRead::lockTop(mongo::LockState&) ()
---Type <return> to continue, or q <return> to quit---
#3 0x0000000000ad9093 in mongo::Lock::DBRead::lockDB(std::string const&) ()
#4 0x0000000000adb095 in mongo::Lock::DBRead::DBRead(mongo::StringData const&) ()
#5 0x00000000007b2333 in mongo::TTLMonitor::run() ()
#6 0x0000000000595fce in mongo::BackgroundJob::jobBody(boost::shared_ptr<mongo::BackgroundJob::JobStatus>) ()
#7 0x0000000000597a84 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, mongo::BackgroundJob, boost::shared_ptr<mongo::BackgroundJob::JobStatus> >, boost::_bi::list2<boost::_bi::value<mongo::BackgroundJob*>, boost::_bi::value<boost::shared_ptr<mongo::BackgroundJob::JobStatus> > > > >::run() ()
#8 0x00000000007c3659 in ?? ()
#9 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x0000000000000000 in ?? ()
Thread 8 (Thread 0x7fdeaddde700 (LWP 1240)):
#0 0x00007fdeb37dc123 in select () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00000000006a4a5a in mongo::Listener::initAndListen() ()
#2 0x00000000008bd940 in mongo::webServerThread(mongo::AdminAccess const*) ()
#3 0x00000000007c3659 in ?? ()
#4 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#5 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x0000000000000000 in ?? ()
Thread 7 (Thread 0x7fcb768b8700 (LWP 8634)):
#0 0x00007fdeb44d514c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000089a053 in mongo::Socket::_recv(char*, int) ()
#2 0x000000000089a069 in mongo::Socket::unsafe_recv(char*, int) ()
#3 0x000000000089d654 in mongo::Socket::recv(char*, int) ()
#4 0x000000000081e59c in mongo::MessagingPort::recv(mongo::Message&) ()
#5 0x00000000005dbef7 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 6 (Thread 0x7fcc785c7700 (LWP 9052)):
#0 0x00007fdeb44d514c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000089a053 in mongo::Socket::_recv(char*, int) ()
#2 0x000000000089a069 in mongo::Socket::unsafe_recv(char*, int) ()
#3 0x000000000089d654 in mongo::Socket::recv(char*, int) ()
#4 0x000000000081e59c in mongo::MessagingPort::recv(mongo::Message&) ()
#5 0x00000000005dbef7 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
---Type <return> to continue, or q <return> to quit---
Thread 5 (Thread 0x7fcb766b6700 (LWP 9479)):
#0 0x00007fdeb44d514c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000089a053 in mongo::Socket::_recv(char*, int) ()
#2 0x000000000089a069 in mongo::Socket::unsafe_recv(char*, int) ()
#3 0x000000000089d654 in mongo::Socket::recv(char*, int) ()
#4 0x000000000081e59c in mongo::MessagingPort::recv(mongo::Message&) ()
#5 0x00000000005dbef7 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 4 (Thread 0x7fcb76ebe700 (LWP 9950)):
#0 0x00007fdeb44d514c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x000000000089a053 in mongo::Socket::_recv(char*, int) ()
#2 0x000000000089a069 in mongo::Socket::unsafe_recv(char*, int) ()
#3 0x000000000089d654 in mongo::Socket::recv(char*, int) ()
#4 0x000000000081e59c in mongo::MessagingPort::recv(mongo::Message&) ()
#5 0x00000000005dbef7 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#6 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x0000000000000000 in ?? ()
Thread 3 (Thread 0x7fcb73575700 (LWP 10492)):
#0 0x00000000006d6078 in mongo::GeoBrowse::addSpecific(mongo::GeoKeyNode const&, mongo::Point const&, bool, double, bool) ()
#1 0x00000000006d1884 in mongo::GeoAccumulator::add(mongo::GeoKeyNode const&) ()
#2 0x00000000006d1347 in mongo::BtreeLocation::checkAndAdvance(mongo::GeoHash const&, int&, mongo::GeoAccumulator*) ()
#3 0x00000000006e34a2 in mongo::GeoBrowse::fillStack(int, int, bool) ()
#4 0x00000000006c7e3a in mongo::GeoBrowse::advance() ()
#5 0x00000000006b0885 in mongo::queryWithQueryOptimizer(int, std::string const&, mongo::BSONObj const&, mongo::CurOp&, mongo::BSONObj const&, mongo::BSONObj const&, boost::shared_ptr<mongo::ParsedQuery> const&, mongo::BSONObj const&, mongo::ShardChunkVersion const&, boost::scoped_ptr<mongo::PageFaultRetryableSection>&, boost::scoped_ptr<mongo::NoPageFaultsAllowed>&, mongo::Message&) ()
#6 0x00000000006b3d38 in mongo::runQuery(mongo::Message&, mongo::QueryMessage&, mongo::CurOp&, mongo::Message&) ()
#7 0x0000000000b5ba7d in ?? ()
#8 0x0000000000b5d052 in mongo::assembleResponse(mongo::Message&, mongo::DbResponse&, mongo::HostAndPort const&) ()
#9 0x000000000056fa52 in mongo::MyMessageHandler::process(mongo::Message&, mongo::AbstractMessagingPort*, mongo::LastError*) ()
#10 0x00000000005dbf11 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#11 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#12 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000000000 in ?? ()
---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0x7fcdb52d7700 (LWP 10536)):
#0 0x00007fdeb44d1d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000007db28b in void boost::condition_variable_any::wait<boost::mutex>(boost::mutex&) ()
#2 0x0000000000ad8f1c in mongo::Lock::DBRead::lockTop(mongo::LockState&) ()
#3 0x0000000000ad9093 in mongo::Lock::DBRead::lockDB(std::string const&) ()
#4 0x0000000000adb095 in mongo::Lock::DBRead::DBRead(mongo::StringData const&) ()
#5 0x000000000066d6ba in mongo::CmdServerStatus::run(std::string const&, mongo::BSONObj&, int, std::string&, mongo::BSONObjBuilder&, bool) ()
#6 0x00000000006571f1 in mongo::_execCommand(mongo::Command*, std::string const&, mongo::BSONObj&, int, mongo::BSONObjBuilder&, bool) ()
#7 0x0000000000658d5d in mongo::execCommand(mongo::Command*, mongo::Client&, int, char const*, mongo::BSONObj&, mongo::BSONObjBuilder&, bool) ()
#8 0x0000000000659c1e in mongo::_runCommands(char const*, mongo::BSONObj&, mongo::_BufBuilder<mongo::TrivialAllocator>&, mongo::BSONObjBuilder&, bool, int) ()
#9 0x00000000006afa08 in mongo::runCommands(char const*, mongo::BSONObj&, mongo::CurOp&, mongo::_BufBuilder<mongo::TrivialAllocator>&, mongo::BSONObjBuilder&, bool, int) ()
#10 0x00000000006b3241 in mongo::runQuery(mongo::Message&, mongo::QueryMessage&, mongo::CurOp&, mongo::Message&) ()
#11 0x0000000000b5ba7d in ?? ()
#12 0x0000000000b5d052 in mongo::assembleResponse(mongo::Message&, mongo::DbResponse&, mongo::HostAndPort const&) ()
#13 0x000000000056fa52 in mongo::MyMessageHandler::process(mongo::Message&, mongo::AbstractMessagingPort*, mongo::LastError*) ()
#14 0x00000000005dbf11 in mongo::pms::threadRun(mongo::MessagingPort*) ()
#15 0x00007fdeb44cde9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#16 0x00007fdeb37e2dbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#17 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x7fdeb48f6b40 (LWP 1018)):
#0 0x00007fdeb37dc123 in select () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00000000006a4a5a in mongo::Listener::initAndListen() ()
#2 0x0000000000559154 in mongo::listen(int) ()
#3 0x000000000055c86a in mongo::_initAndListen(int) ()
#4 0x000000000055d2dd in mongo::initAndListen(int) ()
#5 0x0000000000563dbe in ?? ()
#6 0x0000000000565399 in main ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment