Refactor pg_rewind code and make it work against a standby
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-08-19T12:50:16Z
Lists: pgsql-hackers
Attachments
- 0001-pg_rewind-Move-syncTargetDirectory-to-file_ops.c.patch (text/x-patch)
Hi, I started to hack on making pg_rewind crash-safe (see [1]), but I quickly got side-tracked into refactoring and tidying up up the code in general. I ended up with this series of patches: The first four patches are just refactoring that make the code and the logic more readable. Tom Lane commented about the messy comments earlier (see [2]), and I hope these patches will alleviate that confusion. See commit messages for details. The last patch refactors the logic in libpq_fetch.c, so that it no longer uses a temporary table in the source system. That allows using a hot standby server as the pg_rewind source. This doesn't do anything about pg_rewind's crash-safety yet, but I'll try work on that after these patches. [1] https://www.postgresql.org/message-id/d8dcc760-8780-5084-f066-6d663801d2e2%40iki.fi [2] https://www.postgresql.org/message-id/30255.1522711675%40sss.pgh.pa.us - Heikki
Commits
-
Make pg_rewind test case more stable.
- c71f9a094b32 14.0 landed
-
Fix timing issue in pg_rewind test.
- 39f9f04b5784 14.0 landed
-
Allow pg_rewind to use a standby server as the source system.
- 9c4f5192f69e 14.0 landed
-
pg_rewind: Refactor the abstraction to fetch from local/libpq source.
- 37d2ff380312 14.0 landed
-
pg_rewind: Replace the hybrid list+array data structure with simplehash.
- f81e97d0475c 14.0 landed
-
Refactor pg_rewind for more clear decision making.
- eb00f1d4bf96 14.0 landed
-
pg_rewind: Move syncTargetDirectory() to file_ops.c
- ffb4e27e9c5e 14.0 landed