mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 01:01:16 +02:00
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
This commit is contained in:
parent
aa203e7600
commit
ee01f7092f
@ -2375,6 +2375,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
|
|||||||
{
|
{
|
||||||
GlobalTransaction gxact = NULL;
|
GlobalTransaction gxact = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
Assert(RecoveryInProgress());
|
Assert(RecoveryInProgress());
|
||||||
|
|
||||||
@ -2386,6 +2387,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
|
|||||||
if (gxact->xid == xid)
|
if (gxact->xid == xid)
|
||||||
{
|
{
|
||||||
Assert(gxact->inredo);
|
Assert(gxact->inredo);
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2394,7 +2396,7 @@ PrepareRedoRemove(TransactionId xid, bool giveWarning)
|
|||||||
/*
|
/*
|
||||||
* Just leave if there is nothing, this is expected during WAL replay.
|
* Just leave if there is nothing, this is expected during WAL replay.
|
||||||
*/
|
*/
|
||||||
if (gxact == NULL)
|
if (!found)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user