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 */ 29 extern TimeLineHistoryEntry *targetHistory; 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 */ 55 extern TimeLineHistoryEntry *rewind_parseTimeLineHistory(char *buffer, 56 TimeLineID targetTLI, 57 int *nentries); 58 59 #endif /* PG_REWIND_H */ 60