TM hangs during abort

Bug #1334392 reported by Atanu Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
High
Adriana Fuentes

Bug Description

TM hangs during ABORTRANSATION.
This call is made internally during a ddl operation. When it fails, we abort
the transaction and it hangs with the stack trace shown below.

Interestingly, if I add a little delay before calling aborttransaction, then
abort succeeds.

Thread 1 (Thread 0x7fffed142f60 (LWP 23050)):
#0 0x00000033dec0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fffee221d62 in SB_Thread::CV::wait() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbutil.so
#2 0x00007fffee221de3 in SB_Thread::CV::wait(bool) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbutil.so
#3 0x00007ffff5d0a97a in SB_Trans::Trans_Stream::wait_req_done_static(MS_Md_Type*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbms.so
#4 0x00007ffff5d0a942 in SB_Trans::Trans_Stream::wait_req_done(MS_Md_Type*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbms.so
#5 0x00007ffff5cd07a5 in xmsg_break_com(int, short*, SB_Phandle_Type*, MS_Md_Type**, bool) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbms.so
#6 0x00007ffff5cd051f in BMSG_BREAK_(int, short*, SB_Phandle_Type*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsbms.so
#7 0x00007ffff1db1289 in TMLIB::send_tm(_tmlibmsg_h_as_22*, _tmlibmsg_h_as_43*, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libstmlib.so
#8 0x00007ffff1da7f7b in TM_Transaction::abort(bool) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libstmlib.so
#9 0x00007ffff1dac044 in ABORTTRANSACTION () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libstmlib.so
#10 0x00007ffff50307d5 in ExTransaction::rollbackTransactionWaited() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#11 0x00007ffff5031f9e in ExTransTcb::work() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#12 0x00007ffff4fc14af in ex_tcb::sWork(ex_tcb*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#13 0x00007ffff50c4b17 in ExSubtask::work() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#14 0x00007ffff50c3eda in ExScheduler::work(long) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#15 0x00007ffff50011db in ex_root_tcb::execute(CliGlobals*, ExExeStmtGlobals*, Descriptor*, ComDiagsArea*&, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#16 0x00007ffff625d44b in CliStatement::execute(CliGlobals*, Descriptor*, ComDiagsArea&, CliStatement::ExecState, int, unsigned int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#17 0x00007ffff6203153 in SQLCLI_PerformTasks () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#18 0x00007ffff6203ac4 in SQLCLI_Exec () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#19 0x00007ffff62704fa in SQL_EXEC_Exec () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#20 0x00007ffff5045c16 in ExeCliInterface::exec(char*, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#21 0x00007ffff50467a6 in ExeCliInterface::executeImmediateExec(char const*, char*, int*, int, long*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#22 0x00007ffff5046ab1 in ExeCliInterface::executeImmediate(char const*, char*, int*, int, long*, int, ComDiagsArea*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#23 0x00007ffff5048a1f in ExeCliInterface::rollbackWork() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#24 0x00007ffff12457dd in CmpSeabaseDDL::rollbackXn(ExeCliInterface*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcomp.so
#25 0x00007ffff125e029 in CmpSeabaseDDL::createSeabaseTableCompound(StmtDDLCreateTable*, NAString&, NAString&) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcomp.so
#26 0x00007ffff125132a in CmpSeabaseDDL::executeSeabaseDDL(DDLExpr*, ExprNode*, NAString&, NAString&) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcomp.so
#27 0x00007ffff581fce4 in CmpStatement::process(CmpMessageDDL const&) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libarkcmplib.so
#28 0x00007ffff581352f in CmpContext::compileDirect(char*, unsigned int, NAMemory*, int, CmpMessageObj::MessageTypeEnum, char*&, unsigned int&, unsigned int, ComDiagsArea*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libarkcmplib.so
#29 0x00007ffff4fadb36 in ExDDLTcb::work() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#30 0x00007ffff4fc14af in ex_tcb::sWork(ex_tcb*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#31 0x00007ffff50c4b17 in ExSubtask::work() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#32 0x00007ffff50c3eda in ExScheduler::work(long) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#33 0x00007ffff50011db in ex_root_tcb::execute(CliGlobals*, ExExeStmtGlobals*, Descriptor*, ComDiagsArea*&, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libexecutor.so
#34 0x00007ffff625d44b in CliStatement::execute(CliGlobals*, Descriptor*, ComDiagsArea&, CliStatement::ExecState, int, unsigned int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#35 0x00007ffff6203153 in SQLCLI_PerformTasks () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#36 0x00007ffff6203ac4 in SQLCLI_Exec () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#37 0x00007ffff62704fa in SQL_EXEC_Exec () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libcli.so
#38 0x00007ffff7bbc3ec in SqlCmd::doExec(SqlciEnv*, SQLCLI_OBJ_ID*, PrepStmt*, int, char**, CharInfo::CharSet*, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcilib.so
#39 0x00007ffff7bbd1aa in SqlCmd::do_execute(SqlciEnv*, PrepStmt*, int, char**, CharInfo::CharSet*, int) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcilib.so
#40 0x00007ffff7bbf437 in DML::process(SqlciEnv*) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcilib.so
#41 0x00007ffff7ba9966 in SqlciEnv::executeCommands(InputStmt*&) () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcilib.so
#42 0x00007ffff7ba90a7 in SqlciEnv::run() () from /opt/home/ansharma/ansharma_git/core/sqf/export/lib64d/libsqlcilib.so
#43 0x0000000000401f49 in main ()

--------

Run these queries on your workstation.
Second one will hang.
dtmci output is attached below.

CREATE TABLE tmp_ROWSET_TABLE ( C01 CHAR( 20 ) CHARACTER SET ISO88591 NOT NULL, C02 CHAR( 20 ) CHARACTER SET UCS2, C03 VARCHAR( 20 ) CHARACTER SET ISO88591, C04 VARCHAR( 20 ) CHARACTER SET UCS2, C05 LONG VARCHAR( 20 ) CHARACTER SET ISO88591, C06 LONG VARCHAR( 20 ) CHARACTER SET UCS2, C07 NCHAR( 20 ), C08 NCHAR VARYING( 20 ), C09 DECIMAL (8, 0) SIGNED, C10 DECIMAL (8, 0) UNSIGNED, C11 NUMERIC (8, 0) SIGNED, C12 NUMERIC (8, 0) UNSIGNED, C13 TINYINT SIGNED, C14 TINYINT UNSIGNED, C15 SMALLINT SIGNED, C16 SMALLINT UNSIGNED, C17 INTEGER SIGNED NOT NULL, C18 INTEGER UNSIGNED, C19 LARGEINT NOT NULL NOT DROPPABLE, C20 REAL, C21 FLOAT(54), C22 DOUBLE PRECISION, C23 DATE, C24 TIME, C25 TIMESTAMP, C26 INTERVAL YEAR, C27 INTERVAL MONTH, C28 INTERVAL DAY, C29 INTERVAL HOUR, C30 INTERVAL MINUTE, C31 INTERVAL SECOND, C32 INTERVAL YEAR TO MONTH, C33 INTERVAL DAY TO HOUR, C34 INTERVAL DAY TO MINUTE, C35 INTERVAL DAY TO SECOND, C36 INTERVAL HOUR TO MINUTE, C37 INTERVAL HOUR TO SECOND, C38 INTERVAL MINUTE TO SECOND, C39 NUMERIC (19, 0) SIGNED, C40 NUMERIC (19, 0) UNSIGNED, PRIMARY KEY ( C19 ), CONSTRAINT C17T CHECK ( C17 < 50000 ) );
CREATE TABLE jp_ROWSET_TABLE ( C01 CHAR( 20 ) CHARACTER SET ISO88591 NOT NULL, C02 CHAR( 20 ) CHARACTER SET UCS2, C03 VARCHAR( 20 ) CHARACTER SET ISO88591, C04 VARCHAR( 20 ) CHARACTER SET UCS2, C05 LONG VARCHAR( 20 ) CHARACTER SET ISO88591, C06 LONG VARCHAR( 20 ) CHARACTER SET UCS2, C07 NCHAR( 20 ), C08 NCHAR VARYING( 20 ), C09 DECIMAL (8, 0) SIGNED, C10 DECIMAL (8, 0) UNSIGNED, C11 NUMERIC (8, 0) SIGNED, C12 NUMERIC (8, 0) UNSIGNED, C13 TINYINT SIGNED, C14 TINYINT UNSIGNED, C15 SMALLINT SIGNED, C16 SMALLINT UNSIGNED, C17 INTEGER SIGNED NOT NULL, C18 INTEGER UNSIGNED, C19 LARGEINT NOT NULL NOT DROPPABLE, C20 REAL, C21 FLOAT(54), C22 DOUBLE PRECISION, C23 DATE, C24 TIME, C25 TIMESTAMP, C26 INTERVAL YEAR, C27 INTERVAL MONTH, C28 INTERVAL DAY, C29 INTERVAL HOUR, C30 INTERVAL MINUTE, C31 INTERVAL SECOND, C32 INTERVAL YEAR TO MONTH, C33 INTERVAL DAY TO HOUR, C34 INTERVAL DAY TO MINUTE, C35 INTERVAL DAY TO SECOND, C36 INTERVAL HOUR TO MINUTE, C37 INTERVAL HOUR TO SECOND, C38 INTERVAL MINUTE TO SECOND, C39 NUMERIC (19, 0) SIGNED, C40 NUMERIC (19, 0) UNSIGNED, PRIMARY KEY ( C19 ), CONSTRAINT C17T CHECK ( C17 < 50000 ) );
DTMCI > list
Transid Owner eventQ pending Joiners TSEs State
(0,2011) 0,23050 0 0 0 0 FORGOTTEN willRollback
(0,2045) 0,2408 0 0 0 0 FORGOTTEN willRollback
Node 1 : No Transactions were returned.
DTMCI >

Tags: dtm
Changed in trafodion:
assignee: John de Roo (john-deroo) → Adriana Fuentes (adriana-fuentes)
status: New → Confirmed
Revision history for this message
Adriana Fuentes (adriana-fuentes) wrote :

Timing issue resulted from having doomtx/rollback and abort tx
executing at the same time for the same transaction.

Removed queuing when doomtx is called so that only one doomtx
or abort gets executed for a transaction.

Fix has been included in the following git version:
Change-Id: I58062bb7404b3bec9bb524fc958a34450401af78

Changed in trafodion:
status: Confirmed → Fix Committed
Alice Chen (alchen)
Changed in trafodion:
milestone: none → r0.8
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.