Fix pgbench performance issue induced by commit af35fe501.
[pgsql.git] / src / bin / pg_rewind / pg_rewind.h
blob9cea144d2b2415a6fced93392f152e7c9f8f7c9d
1 /*-------------------------------------------------------------------------
3 * pg_rewind.h
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 *-------------------------------------------------------------------------
11 #ifndef PG_REWIND_H
12 #define PG_REWIND_H
14 #include "access/timeline.h"
15 #include "common/logging.h"
16 #include "common/file_utils.h"
18 /* Configuration options */
19 extern char *datadir_target;
20 extern bool showprogress;
21 extern bool dry_run;
22 extern bool do_sync;
23 extern int WalSegSz;
24 extern DataDirSyncMethod sync_method;
26 /* Target history */
27 extern TimeLineHistoryEntry *targetHistory;
28 extern int targetNentries;
30 /* Progress counters */
31 extern uint64 fetch_size;
32 extern uint64 fetch_done;
34 /* in parsexlog.c */
35 extern void extractPageMap(const char *datadir, XLogRecPtr startpoint,
36 int tliIndex, XLogRecPtr endpoint,
37 const char *restoreCommand);
38 extern void findLastCheckpoint(const char *datadir, XLogRecPtr forkptr,
39 int tliIndex,
40 XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli,
41 XLogRecPtr *lastchkptredo,
42 const char *restoreCommand);
43 extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr,
44 int tliIndex, const char *restoreCommand);
46 /* in pg_rewind.c */
47 extern void progress_report(bool finished);
49 /* in timeline.c */
50 extern TimeLineHistoryEntry *rewind_parseTimeLineHistory(char *buffer,
51 TimeLineID targetTLI,
52 int *nentries);
54 #endif /* PG_REWIND_H */