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-2025, 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
18/* Configuration options */
19extern char *datadir_target;
20extern bool showprogress;
21extern bool dry_run;
22extern bool do_sync;
23extern int WalSegSz;
25
26/* Target history */
28extern int targetNentries;
29
30/* Progress counters */
31extern uint64 fetch_size;
32extern uint64 fetch_done;
33
34/* in parsexlog.c */
35extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
36 int tliIndex, XLogRecPtr endpoint,
37 const char *restoreCommand);
38extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
39 int tliIndex,
40 XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
41 XLogRecPtr *lastchkptredo,
42 const char *restoreCommand);
43extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr,
44 int tliIndex, const char *restoreCommand);
45
46/* in pg_rewind.c */
47extern void progress_report(bool finished);
48
49/* in timeline.c */
51 TimeLineID targetTLI,
52 int *nentries);
53
54#endif /* PG_REWIND_H */
uint64_t uint64
Definition: c.h:503
DataDirSyncMethod
Definition: file_utils.h:28
char * datadir
int WalSegSz
Definition: streamutil.c:32
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:793
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