> -----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