Skip to content

Commit ee01f70

Browse files
Exit correctly from PrepareRedoRemove() when not found
Complex crash bug all started with this failure. Diagnosed and fixed by Nikhil Sontakke, reviewed by me. Reported-by: Jeff Janes Author: Nikhil Sontakke Discussion: https://postgr.es/m/CAMkU=1xBP8cqdS5eK8APHL=X6RHMMM2vG5g+QamduuTsyCwv9g@mail.gmail.com
1 parent aa203e7 commit ee01f70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/access/transam/twophase.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
23752375
{
23762376
GlobalTransaction gxact = NULL;
23772377
int i;
2378+
bool found = false;
23782379

23792380
Assert(RecoveryInProgress());
23802381

@@ -2386,6 +2387,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
23862387
if (gxact->xid == xid)
23872388
{
23882389
Assert(gxact->inredo);
2390+
found = true;
23892391
break;
23902392
}
23912393
}
@@ -2394,7 +2396,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
23942396
/*
23952397
* Just leave if there is nothing, this is expected during WAL replay.
23962398
*/
2397-
if (gxact == NULL)
2399+
if (!found)
23982400
return;
23992401

24002402
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy