티스토리 뷰

반응형

인포믹스에서 Global Transaction이 정상적으로 종료되지 않았을 때 해결방법에 관한 포스트입니다. 사례가 상세해 소개해 드립니다.

(출처: comp.databases.informix newsgroup)


On my Informix instance I have two global transactions holding some locks. See onstat -G and onstat -x output below.
How can I get rid of them?
Also after a server reboot they are still there.
onmode -Z <address> or onmode -H <address> do not work (see below).

IBM Informix Dynamic Server Version 11.50.UC7IE on Solaris SPARC 10.


Global Transaction Identifiers
address flags isol timeout fID gtl bql data
56656bd8 -LX-G LC 0 131075 30 28 312D2D35336530656466663A613139383.....
56656e28 -LX-G LC 0 131075 30 28 312D2D35336530656466663A613139383.....
2 active, 128 total

Transactions

                                                                          est.

address  flags userthread locks  begin_logpos      current logpos isol    rb_time  retrys coord

56655018 A---- 56623018   0      -                 -              COMMIT  -        0

56655268 A---- 56623638   0      -                 -              COMMIT  -        0

566554b8 A---- 56623c58   0      -                 -              COMMIT  -        0

56655708 A---- 56624278   0      -                 -              COMMIT  -        0

56655958 A---- 56624898   0      -                 -              COMMIT  -        0

56655ba8 A---- 56624eb8   0      -                 -              COMMIT  -        0

56655df8 A---- 566254d8   0      -                 -              COMMIT  -        0

56656048 A---- 56625af8   0      -                 -              COMMIT  -        0

56656298 A---- 56626118   0      -                 -              COMMIT  -        0

566564e8 A---- 56626738   0      -                 -              COMMIT  -        0

56656738 A---- 56626d58   0      -                 -              COMMIT  -        0

56656988 A---- 56627378   0      -                 -              COMMIT  -        0

56656bd8 -LX-G 0          2      logid 303         303:0x64b2622c COMMIT  2:58     0

56656e28 -LX-G 0          2      logid 303         303:0x64b2922c COMMIT  2:58     0

56657078 A---- 56627fb8   0      -                 -              COMMIT  -        0

566572c8 A---- 56627998   0      -                 -              COMMIT  -        0

56657e58 A---- 56629218   0      -                 -              COMMIT  -        0

위의 예와 같이 flags 값이 '-LX-G'인 트랜잭션에는 userthread 정보가 없습니다. 이러한 트랜잭션을 orphaned transaction이라고 하는데 userthread가 트랜잭션에서 떨어져나가 멈춰있는 상태입니다. 만약에 이러한 트랜잭션이 Logical Log를 사용중인 채로 멈춰버리면 Long Transaction 상태에 빠질 수도 있습니다.


> onmode -Z 1449487912
onmode: Cannot kill transaction 0x56656e28.
Only I-STAR subordinates that are PREPARE'd or HEURISTICally ABORT'd
may be heuristically completed.

> onmode -H 1449487912
onmode -H may only be used to kill heuristically completed transactions.


여기서는 address를 십진수로 명시해서 onmode를 실행했습니다. onmode -Z (또는 -H) 0x56656e28 같은 형식으로 실행해도 됩니다.

포스트 스레드를 읽다보면 다음과 같은 내용이 있습니다.


Try onmode -l until you have forced a long transaction, this usually
help us. We have requested a way to get rid of these, but it seems
that the view of  IBM that the TM should handle this i all cases.
Problem is that the TM fails sometimes, and then you are stuck.

Regards

Ulf

처음 질문했던 Frank의 경우에는 로그 스위칭이 자연스럽게 발생하면서 Long Transaction이 유발되었습니다. 이는 LTXHWM 구성변수 설정값에 따라 달라지는데 기본값은 70입니다. 만약 Logical Log가 10개라면, 한 트랜잭션이 7번의 로그 스위칭이 일어나는 동안 완료되지 않으면 일반적으로 Long Transaction이 유발됩니다.

Today, the transactions were rolled back by the server:

23:42:09  Aborting Long Transaction: tx: 0x56656bd8 no user info due to XA or distributed (2-phase commit) transaction
23:42:09  Aborting Long Transaction: tx: 0x56656e28 no user info due to XA or distributed (2-phase commit) transaction
23:42:13  Checkpoint Completed:  duration was 4 seconds.
23:42:13  Thu Jul  1 - loguniq 306, logpos 0x3fff33b4, timestamp: 0xdedfaa19 Interval: 5616

23:42:13  Maximum server connections 15
23:42:13  Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 1, Plog used 83432, Llog used 182271

23:42:13  Session completed abnormally. Rolling back tx id 24, flags 0x108463b
23:42:13  Session completed abnormally. Rolling back tx id 32, flags 0x108463b
23:42:13  Long Transaction 0x56656e28 Aborted. Rollback Duration: 0 Seconds
23:42:14  Long Transaction 0x56656bd8 Aborted. Rollback Duration: 0 Seconds

onmode -l로 수동으로 로그 스위칭을 발생시키거나 로그가 쌓이면서 LTXHWM 한계치를 넘을 경우 위와 같이 처리됩니다. 일반적으로는 위와 같이 처리되었을 때 인스턴스나 다른 트랜잭션에는 영향이 없습니다.

onmode -H에 대해서는 공식적인 문서를 찾기는 어렵습니다. 다만 에러메시지로 유추해보건데 (onmode -H may only be used to kill heuristically completed transactions.) 휴리스틱 트랜잭션에만 적용되는 것으로 보입니다.

제 경험상으로는 onstat -G에서 flags 값이 다음과 같은 경우에 사용합니다.

700000379440490  -TH-G 0                0      108002:0xaf7a018  108072:0xd068     DIRTY   26:56    0

70000038ad89b48  -TH-G 0                0      107898:0x4524018  107968:0x6a018    COMMIT  0:00     0

70000038c7ccfa0  -TH-G 0                0      107993:0x14781050 108063:0x9404     DIRTY   32:58    0

70000038c7e1160  -TH-G 0                0      108002:0x2dea018  108072:0x27678    DIRTY   27:10    0

70000038d69e178  -TH-G 0                0      108002:0x39e018   108072:0xe118     DIRTY   27:14    0


flags 값이 '-TH-G' 상태인 경우 LTXHWM 한계치를 넘어도 트랜잭션이 제거되지 않습니다. 이러한 경우에는 부득이 -H 옵션으로 제거할 수는 있으나 IBM Knowledge Center나 onmode 명령에 -H 옵션에 대한 설명이 없으므로 사용에 주의해야 합니다.



http://www.iiug.org/forums/ids/index.cgi/noframes/read/2975

https://groups.google.com/forum/?hl=en&fromgroups=#!topic/comp.databases.informix/egoEcVkTmbY

https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.admin.doc/ids_admin_1066.htm

반응형
댓글