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-2021, 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 /* logging support */
37 #define pg_fatal(...) do { pg_log_fatal(__VA_ARGS__); exit(1); } while(0)
38 
39 /* in parsexlog.c */
40 extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
41  int tliIndex, XLogRecPtr endpoint,
42  const char *restoreCommand);
43 extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
44  int tliIndex,
45  XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
46  XLogRecPtr *lastchkptredo,
47  const char *restoreCommand);
48 extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr,
49  int tliIndex, const char *restoreCommand);
50 
51 /* in pg_rewind.c */
52 extern void progress_report(bool finished);
53 
54 /* in timeline.c */
56  TimeLineID targetTLI,
57  int *nentries);
58 
59 #endif /* PG_REWIND_H */
uint32 TimeLineID
Definition: xlogdefs.h:59
uint64 fetch_size
Definition: pg_rewind.c:75
int targetNentries
Definition: pg_rewind.c:72
int WalSegSz
Definition: streamutil.c:34
char * datadir_target
Definition: pg_rewind.c:59
char * datadir
void progress_report(bool finished)
Definition: pg_rewind.c:733
bool showprogress
Definition: pg_rewind.c:65
XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr, int tliIndex, const char *restoreCommand)
Definition: parsexlog.c:120
uint64 fetch_done
Definition: pg_rewind.c:76
uint64 XLogRecPtr
Definition: xlogdefs.h:21
TimeLineHistoryEntry * targetHistory
Definition: pg_rewind.c:71
void extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex, XLogRecPtr endpoint, const char *restoreCommand)
Definition: parsexlog.c:63
TimeLineHistoryEntry * rewind_parseTimeLineHistory(char *buffer, TimeLineID targetTLI, int *nentries)
Definition: timeline.c:29
bool dry_run
Definition: pg_rewind.c:66
void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr, int tliIndex, XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli, XLogRecPtr *lastchkptredo, const char *restoreCommand)
Definition: parsexlog.c:164
bool do_sync
Definition: pg_rewind.c:67