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-2022, 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 "datapagemap.h"
17 #include "libpq-fe.h"
18 #include "storage/block.h"
19 #include "storage/relfilenode.h"
20 
21 /* Configuration options */
22 extern char *datadir_target;
23 extern bool showprogress;
24 extern bool dry_run;
25 extern bool do_sync;
26 extern int WalSegSz;
27 
28 /* Target history */
30 extern int targetNentries;
31 
32 /* Progress counters */
33 extern uint64 fetch_size;
34 extern uint64 fetch_done;
35 
36 /* in parsexlog.c */
37 extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
38  int tliIndex, XLogRecPtr endpoint,
39  const char *restoreCommand);
40 extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
41  int tliIndex,
42  XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
43  XLogRecPtr *lastchkptredo,
44  const char *restoreCommand);
45 extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr,
46  int tliIndex, const char *restoreCommand);
47 
48 /* in pg_rewind.c */
49 extern void progress_report(bool finished);
50 
51 /* in timeline.c */
53  TimeLineID targetTLI,
54  int *nentries);
55 
56 #endif /* PG_REWIND_H */
char * datadir
int WalSegSz
Definition: streamutil.c:34
void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr, int tliIndex, XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli, XLogRecPtr *lastchkptredo, const char *restoreCommand)
Definition: parsexlog.c:168
TimeLineHistoryEntry * targetHistory
Definition: pg_rewind.c:73
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:60
bool do_sync
Definition: pg_rewind.c:69
uint64 fetch_done
Definition: pg_rewind.c:78
int targetNentries
Definition: pg_rewind.c:74
void progress_report(bool finished)
Definition: pg_rewind.c:737
uint64 fetch_size
Definition: pg_rewind.c:77
XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr, int tliIndex, const char *restoreCommand)
Definition: parsexlog.c:124
bool dry_run
Definition: pg_rewind.c:68
bool showprogress
Definition: pg_rewind.c:67
TimeLineHistoryEntry * rewind_parseTimeLineHistory(char *buffer, TimeLineID targetTLI, int *nentries)
Definition: timeline.c:29
uint64 XLogRecPtr
Definition: xlogdefs.h:21
uint32 TimeLineID
Definition: xlogdefs.h:59