Skip site navigation (1) Skip section navigation (2)

Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END

From: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END
Date: 2007-05-30 19:46:16
Message-ID: 200705302146.17526.ftm.van.vugt@foxi.nl (view raw or flat)
Thread:
Lists: 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.

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-05-30 20:18:03
Subject: Re: backend crash with FATAL: BeginInternalSubTransaction: unexpected state END
Previous:From: Eduardo SantosDate: 2007-05-30 19:40:54
Subject: BUG #3323: Wrong charset for the lower and upper functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group