[pgcluster: 238] Re: デッドロックもしくはそれに類似した症状について

Wataru Oguro oguro @ zenrin-datacom.net
2004年 4月 1日 (木) 17:25:12 JST


oguroです。お世話になります。

谷田様から提供されましたパッチを当てて、lock tableを含む大量トランザク
ションのテストを行いましたが、ロック競合は全く発生しませんでした。

下記トランザクション処理を、2台のクラスタサーバで3時間にわたり流し続けま
したが、問題ありませんでした。
-----
begin;
lock table test;
select * from test;
insert into test values('test');
commit;
-----

谷田様、ありがとうございました。

>以下のpatchはlock tableが対象でないのを解消させるpatchです。本当に適当に
>作っただけなので、誰かなおしてください。
>
>*** postgres.c  2004-03-22 11:32:29.000000000 +0900
>--- postgres.c.new      2004-03-31 15:47:58.000000000 +0900
>***************
>*** 62,67 ****
>--- 62,69 ----
>
>  #ifdef USE_REPLICATION
>  #include "replicate.h"
>+
>+ #define CMD_LOCK 12345
>  #endif /* USE_REPLICATION */
>
>  /* ----------------
>***************
>*** 672,677 ****
>--- 674,682 ----
>                        case T_SelectStmt:
>                                origCmdType = CMD_SELECT;
>                                break;
>+                       case T_LockStmt:
>+                               origCmdType = CMD_LOCK;
>+                               break;
>                        default:
>                                /* Otherwise, never match commandType */
>                                origCmdType = CMD_UNKNOWN;
>***************
>*** 773,779 ****
>                        if ((origCmdType == CMD_INSERT ) ||
>                                (origCmdType == CMD_UPDATE ) ||
>                                (origCmdType == CMD_SELECT ) ||
>!                               (origCmdType == CMD_DELETE ))
>                        {
>                                PGR_Need_Notice = true;
>                                PGR_Check_Lock.check_lock_conflict = true;
>--- 778,785 ----
>                        if ((origCmdType == CMD_INSERT ) ||
>                                (origCmdType == CMD_UPDATE ) ||
>                                (origCmdType == CMD_SELECT ) ||
>!                               (origCmdType == CMD_DELETE ) ||
>!                           (origCmdType == CMD_LOCK)  )
>                        {
>                                PGR_Need_Notice = true;
>                                PGR_Check_Lock.check_lock_conflict = true;
>
>  
>




pgcluster メーリングリストの案内