On Tue, May 10, 2011 at 10:15 PM, ChingChang Hsiao < chingchang.hs...@overturenetworks.com> wrote:
> A script was running for a heavy load DB access. As you can see the sql > statement "select * from service_table where service_no = '13';" in the log. > There is no rows for service_no 13 or 7 in service_table when it is > accessed. The logic is check the entry is there or not, if not then insert > it. Could service_table be locked by previously writing(service_no 12 or 6)? > > ChingChang > ---------------------------------------------------------------- > Version is 3.5.7 > I think you probably mean 3.7.5. > journal mode = DELETE > SELECT sqlite_source_id(); 2011-01-28 17:03:50 > ed759d5a9edb3bba5f48f243df47be29e3fe8cd7 > > OTHER_FLAGS=-DSQLITE_THREADSAFE=2 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 > -DSQLITE_DEBUG=1 > Please recompile with SQLITE_THREADSAFE=1 and let us know if that help. Thanks. > CFLAGS += -O0 -w $(OTHER_FLAGS) > in Makefile > > > > SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *p){ > assert( p->sharable==0 || p->locked==0 || p->wantToLock>0 ); > assert( p->sharable==0 || p->locked==0 || p->db==p->pBt->db ); > assert( p->sharable==0 || p->locked==0 || > sqlite3_mutex_held(p->pBt->mutex) ); > assert( p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->db->mutex) > ); > > return (p->sharable==0 || p->locked); > } > > > (gdb) bt > #0 0x369d5b04 in raise () from /lib/libc.so.6 > #1 0x369d72f4 in abort () from /lib/libc.so.6 > #2 0x369cd2a4 in __assert_fail () from /lib/libc.so.6 > #3 0x364ceb24 in sqlite3BtreeHoldsMutex (p=0x117b94f0) at sqlite3.c:45280 > #4 0x36544a14 in sqlite3Prepare (db=0x11aabd58, > zSql=0x7e64a80c "select * from service_table where service_no = '13';", > nBytes=-1, saveSqlFlag=0, pReprepare=0x0, ppStmt=0x7e64a374, > pzTail=0x7e64a378) at sqlite3.c:87749 > #5 0x365450d8 in sqlite3LockAndPrepare (db=0x11aabd58, > zSql=0x7e64a80c "select * from service_table where service_no = '13';", > nBytes=-1, saveSqlFlag=0, pOld=0x0, ppStmt=0x7e64a374, > pzTail=0x7e64a378) > at sqlite3.c:87878 > #6 0x36545404 in sqlite3_prepare (db=0x11aabd58, > zSql=0x7e64a80c "select * from service_table where service_no = '13';", > nBytes=-1, ppStmt=0x7e64a374, pzTail=0x7e64a378) at sqlite3.c:87941 > #7 0x3653e87c in sqlite3_exec (db=0x11aabd58, > zSql=0x7e64a80c "select * from service_table where service_no = '13';", > xCallback=0x36551600 <sqlite3_get_table_cb>, pArg=0x7e64a3e8, > pzErrMsg=0x7e64a4f4) at sqlite3.c:84507 > #8 0x36551ab4 in sqlite3_get_table (db=0x11aabd58, > zSql=0x7e64a80c "select * from service_table where service_no = '13';", > pazResult=0x7e64a5f8, pnRow=0x7e64a5fc, pnColumn=0x7e64a600, > pzErrMsg=0x7e64a4f4) at sqlite3.c:92613 > #9 0x36377594 in SqlQuery::exec (this=0x36af9f44, > sql_stmt=0x7e64a80c "select * from service_table where service_no = > '13';", context=<value optimized out>, linenum=292215768, warnings=true) > at SqlQuery.cpp:229 > #10 0x36377ec0 in SqlQuery::exec (this=0x0, > sql_stmt=0x1ede <Address 0x1ede out of bounds>, warnings=32) > at SqlQuery.cpp:255 > #11 0x1004869c in IsgServiceType (theTaskDataPtr=<value optimized out>, > theArgArrayPtr=<value optimized out>, > theVariableNamePtr=0x101ff180 "ip-forward", > theOutputStringPtr=0x1031b440 "", > theUserCookiePtrPtr=<value optimized out>) at IsgService.cc:711 > #12 0x101c1bcc in RcParseLine (theConnectionPtr=0x11681900) > at ./RomCLI/Sources/RcParse.c:606 > #13 0x101be784 in RcFiniteStateMachine (theConnectionPtr=0x11681900) > at ./RomCLI/Sources/RcCmdLin.c:913 > #14 0x101c5c44 in HandleConnectionTask (theConnectionPtr=<value optimized > out>) > at ./Engine/Sources/AsMain.c:1861 > #15 AllegroMainTask (theTaskDataPtr=0x116805d0, > theHttpTasks=<value optimized out>, theTcpTasks=0x7e64eb64) > at ./Engine/Sources/AsMain.c:1483 > #16 0x101851e0 in instantiate_task () > at ./Interfaces/LinuxUnix/SingleTask/RpTask.c:253 > #17 c_main (argc=<value optimized out>, argv=<value optimized out>) > at ./Interfaces/LinuxUnix/SingleTask/RpTask.c:105 > #18 0x10184070 in app_main (argc=1, argv=0x7e653ca4) > at ./Interfaces/LinuxUnix/SingleTask/RpStart.cpp:297 > #19 0x1000d2d4 in main (argc=1, argv=0x7e653ca4) > at > /mnt/local/cch/bugfix_test_11_01_02232011/isg6000/MaestrOS/mgmt-crd/linux > > > Program terminated with signal 6, Aborted. > #0 0x31695b04 in raise () from /lib/libc.so.6 > (gdb) bt > #0 0x31695b04 in raise () from /lib/libc.so.6 > #1 0x316972f4 in abort () from /lib/libc.so.6 > #2 0x3168d2a4 in __assert_fail () from /lib/libc.so.6 > #3 0x3116e404 in sqlite3BtreeHoldsMutex (p=0x117af8d0) at sqlite3.c:45280 > #4 0x311ff2f0 in sqlite3Prepare (db=0x3123b04c, > zSql=0x797c298c "select * from service_table where service_no = '7';", > nBytes=-1, saveSqlFlag=0, > pReprepare=<value optimized out>, ppStmt=0x797c24e4, pzTail=0x797c24e8) > at sqlite3.c:87749 > #5 0x311ffd44 in sqlite3LockAndPrepare (db=0x11d354a8, > zSql=0x797c298c "select * from service_table where service_no = '7';", > nBytes=-1, saveSqlFlag=0, > pOld=0x0, ppStmt=0x797c24e4, pzTail=0x797c24e8) at sqlite3.c:87878 > #6 0x31200440 in sqlite3_prepare (db=0x0, zSql=0xefc <Address 0xefc out of > bounds>, nBytes=6, > ppStmt=0xffffffc0, pzTail=0xfffff104) at sqlite3.c:87941 > #7 0x31202264 in sqlite3_exec (db=0x11d354a8, > zSql=0x797c298c "select * from service_table where service_no = '7';", > xCallback=0x31189f2c <sqlite3_get_table_cb>, pArg=0x797c2550, > pzErrMsg=0x797c2674) > at sqlite3.c:84507 > #8 0x3120276c in sqlite3_get_table (db=0x11d354a8, > zSql=0x797c298c "select * from service_table where service_no = '7';", > pazResult=0x797c2778, > pnRow=0x797c277c, pnColumn=0x797c2780, pzErrMsg=0x797c2674) at > sqlite3.c:92613 > #9 0x3104d594 in SqlQuery::exec (this=0x797c2778, > sql_stmt=0x797c298c "select * from service_table where service_no = > '7';", > context=<value optimized out>, linenum=292207096, warnings=true) at > SqlQuery.cpp:229 > #10 0x3104dec0 in SqlQuery::exec (this=0x0, sql_stmt=0xefc <Address 0xefc > out of bounds>, > warnings=32) at SqlQuery.cpp:255 > #11 0x1004869c in IsgServiceType (theTaskDataPtr=<value optimized out>, > theArgArrayPtr=<value optimized out>, theVariableNamePtr=0x101ff180 > "ip-forward", > theOutputStringPtr=0x1031b440 "", theUserCookiePtrPtr=<value optimized > out>) at IsgService.cc:711 > #12 0x101c1bcc in RcParseLine (theConnectionPtr=0x11681900) at > ./RomCLI/Sources/RcParse.c:606 > #13 0x101be784 in RcFiniteStateMachine (theConnectionPtr=0x11681900) > at ./RomCLI/Sources/RcCmdLin.c:913 > #14 0x101c5c44 in HandleConnectionTask (theConnectionPtr=<value optimized > out>) > at ./Engine/Sources/AsMain.c:1861 > #15 AllegroMainTask (theTaskDataPtr=0x116805d0, theHttpTasks=<value > optimized out>, > theTcpTasks=0x797c6ce4) at ./Engine/Sources/AsMain.c:1483 > #16 0x101851e0 in instantiate_task () at > ./Interfaces/LinuxUnix/SingleTask/RpTask.c:253 > #17 c_main (argc=<value optimized out>, argv=<value optimized out>) > at ./Interfaces/LinuxUnix/SingleTask/RpTask.c:105 > #18 0x10184070 in app_main (argc=1, argv=0x797cbe24) > at ./Interfaces/LinuxUnix/SingleTask/RpStart.cpp:297 > #19 0x1000d2d4 in main (argc=1, argv=0x797cbe24) > at > /mnt/local/cch/bugfix_test_11_01_02232011/isg6000/MaestrOS/mgmt-crd/linuxapps/main.cpp:220 > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users