PostgreSQL Source Code  git master
pg_rewind.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_rewind.h
4  *
5  *
6  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *-------------------------------------------------------------------------
10  */
11 #ifndef PG_REWIND_H
12 #define PG_REWIND_H
13 
14 #include "access/timeline.h"
15 #include "common/logging.h"
16 #include "common/file_utils.h"
17 #include "datapagemap.h"
18 #include "libpq-fe.h"
19 #include "storage/block.h"
20 #include "storage/relfilelocator.h"
21 
22 /* Configuration options */
23 extern char *datadir_target;
24 extern bool showprogress;
25 extern bool dry_run;
26 extern bool do_sync;
27 extern int WalSegSz;
29 
30 /* Target history */
32 extern int targetNentries;
33 
34 /* Progress counters */
35 extern uint64 fetch_size;
36 extern uint64 fetch_done;
37 
38 /* in parsexlog.c */
39 extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
40  int tliIndex, XLogRecPtr endpoint,
41  const char *restoreCommand);
42 extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
43  int tliIndex,
44  XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
45  XLogRecPtr *lastchkptredo,
46  const char *restoreCommand);
47 extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr,
48  int tliIndex, const char *restoreCommand);
49 
50 /* in pg_rewind.c */
51 extern void progress_report(bool finished);
52 
53 /* in timeline.c */
55  TimeLineID targetTLI,
56  int *nentries);
57 
58 #endif /* PG_REWIND_H */
DataDirSyncMethod
Definition: file_utils.h:28
char * datadir
int WalSegSz
Definition: streamutil.c:34
TimeLineHistoryEntry * targetHistory
Definition: pg_rewind.c:81
void extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex, XLogRecPtr endpoint, const char *restoreCommand)
Definition: parsexlog.c:66
char * datadir_target
Definition: pg_rewind.c:67
void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr, int tliIndex, XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli, XLogRecPtr *lastchkptredo, const char *restoreCommand)
Definition: parsexlog.c:168
bool do_sync
Definition: pg_rewind.c:76
uint64 fetch_done
Definition: pg_rewind.c:86
int targetNentries
Definition: pg_rewind.c:82
void progress_report(bool finished)
Definition: pg_rewind.c:788
uint64 fetch_size
Definition: pg_rewind.c:85
XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr, int tliIndex, const char *restoreCommand)
Definition: parsexlog.c:124
bool dry_run
Definition: pg_rewind.c:75
DataDirSyncMethod sync_method
Definition: pg_rewind.c:78
bool showprogress
Definition: pg_rewind.c:74
TimeLineHistoryEntry * rewind_parseTimeLineHistory(char *buffer, TimeLineID targetTLI, int *nentries)
Definition: timeline.c:28
uint64 XLogRecPtr
Definition: xlogdefs.h:21
uint32 TimeLineID
Definition: xlogdefs.h:59