PostgreSQL Source Code
git master
|
#include "access/timeline.h"
#include "common/logging.h"
#include "datapagemap.h"
#include "libpq-fe.h"
#include "storage/block.h"
#include "storage/relfilenode.h"
Go to the source code of this file.
Macros | |
#define | pg_fatal(...) do { pg_log_fatal(__VA_ARGS__); exit(1); } while(0) |
Functions | |
void | extractPageMap (const char *datadir, XLogRecPtr startpoint, int tliIndex, XLogRecPtr endpoint, const char *restoreCommand) |
void | findLastCheckpoint (const char *datadir, XLogRecPtr searchptr, int tliIndex, XLogRecPtr *lastchkptrec, TimeLineID *lastchkpttli, XLogRecPtr *lastchkptredo, const char *restoreCommand) |
XLogRecPtr | readOneRecord (const char *datadir, XLogRecPtr ptr, int tliIndex, const char *restoreCommand) |
void | progress_report (bool finished) |
TimeLineHistoryEntry * | rewind_parseTimeLineHistory (char *buffer, TimeLineID targetTLI, int *nentries) |
Variables | |
char * | datadir_target |
bool | showprogress |
bool | dry_run |
bool | do_sync |
int | WalSegSz |
TimeLineHistoryEntry * | targetHistory |
int | targetNentries |
uint64 | fetch_size |
uint64 | fetch_done |
#define pg_fatal | ( | ... | ) | do { pg_log_fatal(__VA_ARGS__); exit(1); } while(0) |
Definition at line 37 of file pg_rewind.h.
Referenced by adjust_data_dir(), check_cluster_compatibility(), check_cluster_versions(), check_control_data(), check_file_clone(), check_for_data_type_usage(), check_for_isn_and_int8_passing_mismatch(), check_for_jsonb_9_4_usage(), check_for_new_tablespace_dir(), check_for_pg_role_prefix(), check_for_prepared_transactions(), check_for_reg_data_type_usage(), check_for_tables_with_oids(), check_for_user_defined_postfix_ops(), check_hard_link(), check_is_install_user(), check_loadable_libraries(), check_locale_and_encoding(), check_new_cluster_is_empty(), check_pghost_envvar(), check_proper_datallowconn(), check_required_directory(), checkControlFile(), cloneFile(), close_target_file(), copyFile(), create_script_for_old_cluster_deletion(), create_target(), create_target_dir(), create_target_symlink(), createBackupLabel(), decide_file_action(), digestControlFile(), disable_old_cluster(), ensureCleanShutdown(), exec_prog(), extractPageInfo(), extractPageMap(), findCommonAncestorTimeline(), findLastCheckpoint(), gen_db_file_maps(), get_bin_version(), get_canonical_locale_name(), get_control_data(), get_loadable_libraries(), get_major_server_version(), get_sock_dir(), getRestoreCommand(), getTimelineHistory(), init_libpq_conn(), init_tablespaces(), libpq_fetch_file(), libpq_get_current_wal_insert_lsn(), libpq_traverse_files(), linkFile(), local_fetch_file_range(), main(), new_9_0_populate_pg_largeobject_metadata(), old_11_check_for_sql_identifier_data_type_usage(), old_9_3_check_for_line_data_type_usage(), old_9_6_check_for_unknown_data_type_usage(), old_9_6_invalidate_hash_indexes(), open_target_file(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), parseCommandLine(), perform_rewind(), pid_lock_file_exists(), process_queued_fetch_requests(), process_source_file(), process_target_file(), process_target_wal_block_change(), readOneRecord(), reap_child(), recurse_dir(), remove_new_subdir(), remove_target(), remove_target_dir(), remove_target_file(), remove_target_symlink(), rewriteVisibilityMap(), run_simple_command(), run_simple_query(), sanityChecks(), setup(), slurpFile(), start_postmaster(), transfer_all_new_dbs(), transfer_relfile(), truncate_target_file(), validate_exec(), verify_directories(), and write_target_range().
void extractPageMap | ( | const char * | datadir, |
XLogRecPtr | startpoint, | ||
int | tliIndex, | ||
XLogRecPtr | endpoint, | ||
const char * | restoreCommand | ||
) |
Definition at line 63 of file parsexlog.c.
References Assert, close, XLogReaderState::EndRecPtr, extractPageInfo(), pg_fatal, XLogPageReadPrivate::restoreCommand, SimpleXLogPageRead(), XLogPageReadPrivate::tliIndex, WalSegSz, XL_ROUTINE, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, and XLogReadRecord().
Referenced by main().
void findLastCheckpoint | ( | const char * | datadir, |
XLogRecPtr | searchptr, | ||
int | tliIndex, | ||
XLogRecPtr * | lastchkptrec, | ||
TimeLineID * | lastchkpttli, | ||
XLogRecPtr * | lastchkptredo, | ||
const char * | restoreCommand | ||
) |
Definition at line 164 of file parsexlog.c.
References close, pg_fatal, CheckPoint::redo, XLogPageReadPrivate::restoreCommand, SimpleXLogPageRead(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, CheckPoint::ThisTimeLineID, XLogPageReadPrivate::tliIndex, WalSegSz, XLogRecord::xl_prev, XL_ROUTINE, XLOG_CHECKPOINT_ONLINE, XLOG_CHECKPOINT_SHUTDOWN, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, XLogReadRecord(), XLogRecGetData, XLogRecGetInfo, XLogRecGetRmid, XLogSegmentOffset, and XLR_INFO_MASK.
Referenced by main().
void progress_report | ( | bool | finished | ) |
Definition at line 734 of file pg_rewind.c.
References _, fetch_done, fetch_size, fprintf, INT64_FORMAT, last_progress_report, now(), showprogress, and snprintf.
Referenced by perform_rewind().
XLogRecPtr readOneRecord | ( | const char * | datadir, |
XLogRecPtr | ptr, | ||
int | tliIndex, | ||
const char * | restoreCommand | ||
) |
Definition at line 120 of file parsexlog.c.
References close, XLogReaderState::EndRecPtr, pg_fatal, XLogPageReadPrivate::restoreCommand, SimpleXLogPageRead(), XLogPageReadPrivate::tliIndex, WalSegSz, XL_ROUTINE, XLogBeginRead(), xlogreader, XLogReaderAllocate(), XLogReaderFree(), xlogreadfd, and XLogReadRecord().
Referenced by main().
TimeLineHistoryEntry* rewind_parseTimeLineHistory | ( | char * | buffer, |
TimeLineID | targetTLI, | ||
int * | nentries | ||
) |
Definition at line 29 of file timeline.c.
References TimeLineHistoryEntry::begin, TimeLineHistoryEntry::end, InvalidXLogRecPtr, pg_log_error, pg_malloc(), pg_realloc(), and TimeLineHistoryEntry::tli.
Referenced by getTimelineHistory().
char* datadir_target |
Definition at line 59 of file pg_rewind.c.
Referenced by create_target_dir(), create_target_symlink(), ensureCleanShutdown(), getRestoreCommand(), getTimelineHistory(), main(), open_target_file(), perform_rewind(), remove_target_dir(), remove_target_file(), remove_target_symlink(), sync_target_dir(), and truncate_target_file().
bool do_sync |
Definition at line 67 of file pg_rewind.c.
Referenced by main(), and perform_rewind().
bool dry_run |
Definition at line 66 of file pg_rewind.c.
Referenced by create_target_dir(), create_target_symlink(), ensureCleanShutdown(), main(), open_target_file(), perform_rewind(), remove_target_dir(), remove_target_file(), remove_target_symlink(), sync_target_dir(), truncate_target_file(), and write_target_range().
uint64 fetch_done |
Definition at line 76 of file pg_rewind.c.
Referenced by main(), progress_report(), and write_target_range().
uint64 fetch_size |
Definition at line 75 of file pg_rewind.c.
Referenced by main(), postgres_fdw_validator(), and progress_report().
bool showprogress |
Definition at line 65 of file pg_rewind.c.
Referenced by main(), perform_rewind(), and progress_report().
TimeLineHistoryEntry* targetHistory |
Definition at line 71 of file pg_rewind.c.
Referenced by SimpleXLogPageRead().
int targetNentries |
Definition at line 72 of file pg_rewind.c.
Referenced by findCommonAncestorTimeline(), getTimelineHistory(), main(), and SimpleXLogPageRead().
int WalSegSz |
Definition at line 38 of file pg_standby.c.
Referenced by AuxiliaryProcessMain(), close_walfile(), createBackupLabel(), CustomizableNextWALFileReady(), digestControlFile(), extractPageMap(), findLastCheckpoint(), FindStreamingStart(), main(), open_walfile(), ProcessXLogDataMsg(), readOneRecord(), ReceiveXlogStream(), RetrieveWalSegSize(), SetWALFileNameForCleanup(), SetWALSegSize(), SimpleXLogPageRead(), StartLogStreamer(), and StreamLog().