Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END - Mailing list pgsql-bugs

From Frank van Vugt
Subject Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END
Date
Msg-id 200705302146.17526.ftm.van.vugt@foxi.nl
Whole thread Raw
In response to Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> > Ok, so for patch-sake, when I change BeginInternalSubTransaction() in
> > xact.c by moving these two cases to the upper set
> > (TBLOCK_STARTED/INPROGRESS/SUBINPROGRESS), then I should be ok?

> Try it and see ...

Been there, done that, seems to work (both the example as well as my usecase).

Will keep an eye on the committers list to see what eventually makes it 'til
there. What did the trick for me was:


# diff -u src/backend/access/transam/xact.c_orig
src/backend/access/transam/xact.c
--- src/backend/access/transam/xact.c_orig      2007-05-30 17:38:10.000000000
+0200
+++ src/backend/access/transam/xact.c   2007-05-30 18:34:40.000000000 +0200
@@ -3319,6 +3319,8 @@
                case TBLOCK_STARTED:
                case TBLOCK_INPROGRESS:
                case TBLOCK_SUBINPROGRESS:
+               case TBLOCK_END:
+               case TBLOCK_PREPARE:
                        /* Normal subtransaction start */
                        PushTransaction();
                        s = CurrentTransactionState;            /* changed by
push */
@@ -3335,7 +3337,6 @@
                case TBLOCK_DEFAULT:
                case TBLOCK_BEGIN:
                case TBLOCK_SUBBEGIN:
-               case TBLOCK_END:
                case TBLOCK_SUBEND:
                case TBLOCK_ABORT:
                case TBLOCK_SUBABORT:
@@ -3345,7 +3346,6 @@
                case TBLOCK_SUBABORT_PENDING:
                case TBLOCK_SUBRESTART:
                case TBLOCK_SUBABORT_RESTART:
-               case TBLOCK_PREPARE:
                        elog(FATAL, "BeginInternalSubTransaction: unexpected
state %s",
                                 BlockStateAsString(s->blockState));
                        break;



So Tom, thanks a lot for your swift reply and solution !


--
Best,




Frank.

pgsql-bugs by date:

Previous
From: Pedro Gimeno Fortea
Date:
Subject: Re: BUG #3319: Superuser can't revoke grants on a schema given by aother user
Next
From: Pedro Gimeno Fortea
Date:
Subject: Re: BUG #3319: Superuser can't revoke grants on a schema given by aother user