RE: Orphaned locks in 7.0? - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject RE: Orphaned locks in 7.0?
Date
Msg-id 000501bfc6c0$bade1400$2801007e@tpf.co.jp
Whole thread Raw
In response to Orphaned locks in 7.0?  (Alfred Perlstein <bright@wintelcom.net>)
List pgsql-hackers
> -----Original Message-----
> From: Hiroshi Inoue
> > -----Original Message-----
> > From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> > 
> > Anyway, it sounds like we agree that this is the approach to pursue.
> > Do you have time to chase down the details?
> 
> OK,I will examine a little though I'm a little busy this week.
>

Sorry,I'm so late and haven't so much time to examin the details.
I'm afraid another point now.
Woundn't this change waste XIDs in case of abort loop ?

Anyway,I examied the loop in PostgresMain()(;;){ .. StartTransactionCommand() .. pg_exec_query() ..
CommitTransactionCommand()(/AbortCurrentTrabsaction())..}
 

In my thoughts,the follwoing commands preceded by +?
would be added,ones preceded by -? would be removed.

StartTransactionCommand()TBLOCK_DEFAULT    StartTransaction()    ->TBLOCK_BEGIN                ->
TBLOCK_INPROGRESSTBLOCK_INPROGRES               ->TBLOCK_END        CommitTransaction()    ->
StartTransaction()   -> TBLOCK_DEFAULTTBLOCK_ABORT                ->TBLOCK_ENDABORT                ->
 
CommitTransactionCommand()TBLOCK_DEFAULT    CommitTransaction()    ->TBLOCK_BEGIN                ->
TBLOCK_INPROGRESSTBLOCK_INPROGRESS   CommandCounterIncrement()    ->TBLOCK_END        CommitTransaction()    ->
TBLOCK_DEFAULTTBLOCK_ABORT   +? AbortTransaction()            +? StartTransaction()    ->TBLOCK_ENDABORT    +?
AbortTransaction()   -> TBLOCK_DEFAULT
 

BeginTransactionBlock() ( <- BEGIN command )TRANS_DISABLED                ->otherwise        -> TBLOCK_BEGIN    ->
TBLOCK_INPROGRESS

UserAbortTransaction() ( <- ROLLBACK command )TRANS_DISABLED                ->TBLOCK_INPROGRESS     -?
AbortTransaction()   -> TBLOCK_ENDABORTTBLOCK_ABORT                -> TBLOCK_ENDABORTotherwise        -?
AbortTransaction()   -> TBLOCK_ENDABORT
 

EndTransactionBlock() ( <- COMMIT command )TRANS_DISABLED                ->TBLOCK_INPROGRESS                ->
TBLOCK_END   TBLOCK_ABORT                -> TBLOCK_ENDABORTotherwise                    -> TBLOCK_ENDABORT
 

AbortCurrentTransaction() ( elog(ERROR/FATAL) )TBLOCK_DEFAULT    AbortTransaction()    ->TBLOCK_BEGIN
AbortTransaction()           +? StartTransaction()    -> TBLOCK_ABORTTBLOCK_INGRESS    AbortTransaction()            +?
StartTransaction()   -> TBLOCK_ABORTTBLOCK_END        AbortTransaction()    -> TBLOCK_DEFAULTTBLOCK_ABORT    +?
AbortTransaction()           +? StartTransaction()    ->TBLOCK_ENDABORT    +? AbortTransaction()    -> TBLOCK_DEFAULT
 

AbortOutAnyTransaction() ( Async_UnlistenOnExit() )TRANS_DEFAULT                -> TBLOCK_DEFAULTotherwise
AbortTransaction()   -> TBLOCK_DEFAULT
 


Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: gram.y PROBLEM with UNDER
Next
From: "Hiroshi Inoue"
Date:
Subject: smgrwrite() without LockBuffer(was RE: Shouldn't flush dirty buffers at shutdown ?)