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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group