Re: The same 2PC data maybe recovered twice
suyu.cmj <mengjuan.cmj@alibaba-inc.com>
From: "suyu.cmj" <mengjuan.cmj@alibaba-inc.com>
To: "Michael Paquier" <michael@paquier.xyz>
Cc: "pgsql-hackers" <pgsql-hackers@postgresql.org>
Date: 2025-07-14T09:57:18Z
Lists: pgsql-bugs, pgsql-hackers
> Actually, what you are doing is incorrect because we could miss some > ERRORs for example if a base backup was incorrect if come files were > present in pg_twophase? Yes, you are right, base backup with incorrect files would be a problem. > It's not really true that what you are changing here has no > interaction with the beginning of recovery, the other thread is about > the fact that reading the 2PC files from disk when !reachedConsistency > is a bad concept that we should avoid, impacting the assumption the > code path you are changing here relies on. At the end, it may be > possible that we're able to remove this check entirely.. Is there any recent discussion or plan regarding this? I noticed that in the latest code branch, 2PC data on disk is still being restored when !reachedConsistency. If there are any updates or discussions, I would greatly appreciate it if you could let me know Best regards
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix recovery of 2PC transaction during crash recovery
- bc0581f8fb8b 11.21 landed
- d2ee542a2bbe 12.16 landed
- db59108a2b67 13.12 landed
- 442749100d34 14.9 landed
- a878eff6b4b9 15.4 landed
- f88bc9f38839 16.0 landed
- cb0cca188072 17.0 landed