Skip to content

Commit 37d2ff3

Browse files
committed
pg_rewind: Refactor the abstraction to fetch from local/libpq source.
This makes the abstraction of a "source" server more clear, by introducing a common abstract class, borrowing the object-oriented programming term, that represents all the operations that can be done on the source server. There are two implementations of it, one for fetching via libpq, and another to fetch from a local directory. This adds some code, but makes it easier to understand what's going on. The copy_executeFileMap() and libpq_executeFileMap() functions contained basically the same logic, just calling different functions to fetch the source files. Refactor so that the common logic is in one place, in a new function called perform_rewind(). Reviewed-by: Kyotaro Horiguchi, Soumyadeep Chakraborty Discussion: https://www.postgresql.org/message-id/0c5b3783-af52-3ee5-f8fa-6e794061f70d%40iki.fi
1 parent f81e97d commit 37d2ff3

File tree

12 files changed

+697
-631
lines changed

12 files changed

+697
-631
lines changed

src/bin/pg_rewind/Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
2020

2121
OBJS = \
2222
$(WIN32RES) \
23-
copy_fetch.o \
2423
datapagemap.o \
25-
fetch.o \
2624
file_ops.o \
2725
filemap.o \
28-
libpq_fetch.o \
26+
libpq_source.o \
27+
local_source.o \
2928
parsexlog.o \
3029
pg_rewind.o \
3130
timeline.o \

src/bin/pg_rewind/copy_fetch.c

-266
This file was deleted.

src/bin/pg_rewind/fetch.c

-60
This file was deleted.

src/bin/pg_rewind/fetch.h

-44
This file was deleted.

0 commit comments

Comments
 (0)