Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1fef3d5

Browse files
Fix corruption of 2PC recovery with subxacts
Reading 2PC state files during recovery was borked, causing corruptions duringrecovery. Effect limited to servers with 2PC, subtransactions andrecovery/replication.Stas Kelvich, reviewed by Michael Paquier and Pavan Deolasee
1 parent1fa42de commit1fef3d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/access/transam/twophase.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,8 +1758,9 @@ PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p)
17581758
* need to hold a lock while examining it. We still acquire the
17591759
* lock to modify it, though.
17601760
*/
1761-
subxids= (TransactionId*)
1762-
(buf+MAXALIGN(sizeof(TwoPhaseFileHeader)));
1761+
subxids= (TransactionId*) (buf+
1762+
MAXALIGN(sizeof(TwoPhaseFileHeader))+
1763+
MAXALIGN(hdr->gidlen));
17631764
for (i=0;i<hdr->nsubxacts;i++)
17641765
{
17651766
TransactionIdsubxid=subxids[i];
@@ -1877,8 +1878,9 @@ StandbyRecoverPreparedTransactions(bool overwriteOK)
18771878
* Examine subtransaction XIDs ... they should all follow main
18781879
* XID.
18791880
*/
1880-
subxids= (TransactionId*)
1881-
(buf+MAXALIGN(sizeof(TwoPhaseFileHeader)));
1881+
subxids= (TransactionId*) (buf+
1882+
MAXALIGN(sizeof(TwoPhaseFileHeader))+
1883+
MAXALIGN(hdr->gidlen));
18821884
for (i=0;i<hdr->nsubxacts;i++)
18831885
{
18841886
TransactionIdsubxid=subxids[i];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp