PostgreSQL Source Code
git master
|
#include "access/xlogbackup.h"
#include "common/relpath.h"
#include "storage/block.h"
#include "utils/palloc.h"
Go to the source code of this file.
Macros | |
#define | INCREMENTAL_MAGIC 0xd3ae1f0d |
Typedefs | |
typedef struct IncrementalBackupInfo | IncrementalBackupInfo |
Enumerations | |
enum | FileBackupMethod { BACK_UP_FILE_FULLY , BACK_UP_FILE_INCREMENTALLY } |
Functions | |
IncrementalBackupInfo * | CreateIncrementalBackupInfo (MemoryContext) |
void | AppendIncrementalManifestData (IncrementalBackupInfo *ib, const char *data, int len) |
void | FinalizeIncrementalManifest (IncrementalBackupInfo *ib) |
void | PrepareForIncrementalBackup (IncrementalBackupInfo *ib, BackupState *backup_state) |
char * | GetIncrementalFilePath (Oid dboid, Oid spcoid, RelFileNumber relfilenumber, ForkNumber forknum, unsigned segno) |
FileBackupMethod | GetFileBackupMethod (IncrementalBackupInfo *ib, const char *path, Oid dboid, Oid spcoid, RelFileNumber relfilenumber, ForkNumber forknum, unsigned segno, size_t size, unsigned *num_blocks_required, BlockNumber *relative_block_numbers, unsigned *truncation_block_length) |
size_t | GetIncrementalFileSize (unsigned num_blocks_required) |
size_t | GetIncrementalHeaderSize (unsigned num_blocks_required) |
#define INCREMENTAL_MAGIC 0xd3ae1f0d |
Definition at line 20 of file basebackup_incremental.h.
typedef struct IncrementalBackupInfo IncrementalBackupInfo |
Definition at line 1 of file basebackup_incremental.h.
enum FileBackupMethod |
Enumerator | |
---|---|
BACK_UP_FILE_FULLY | |
BACK_UP_FILE_INCREMENTALLY |
Definition at line 22 of file basebackup_incremental.h.
void AppendIncrementalManifestData | ( | IncrementalBackupInfo * | ib, |
const char * | data, | ||
int | len | ||
) |
Definition at line 196 of file basebackup_incremental.c.
References appendBinaryStringInfo(), IncrementalBackupInfo::buf, StringInfoData::data, data, IncrementalBackupInfo::inc_state, json_parse_manifest_incremental_chunk(), StringInfoData::len, len, MAX_CHUNK, IncrementalBackupInfo::mcxt, MemoryContextSwitchTo(), and MIN_CHUNK.
Referenced by HandleUploadManifestPacket().
IncrementalBackupInfo* CreateIncrementalBackupInfo | ( | MemoryContext | mcxt | ) |
Definition at line 154 of file basebackup_incremental.c.
References IncrementalBackupInfo::buf, context, IncrementalBackupInfo::inc_state, initStringInfo(), json_parse_manifest_incremental_init(), IncrementalBackupInfo::manifest_files, manifest_process_file(), manifest_process_system_identifier(), manifest_process_version(), manifest_process_wal_range(), manifest_report_error(), IncrementalBackupInfo::mcxt, MemoryContextSwitchTo(), and palloc0().
Referenced by UploadManifest().
void FinalizeIncrementalManifest | ( | IncrementalBackupInfo * | ib | ) |
Definition at line 229 of file basebackup_incremental.c.
References IncrementalBackupInfo::buf, StringInfoData::data, IncrementalBackupInfo::inc_state, json_parse_manifest_incremental_chunk(), json_parse_manifest_incremental_shutdown(), StringInfoData::len, IncrementalBackupInfo::mcxt, MemoryContextSwitchTo(), and pfree().
Referenced by UploadManifest().
FileBackupMethod GetFileBackupMethod | ( | IncrementalBackupInfo * | ib, |
const char * | path, | ||
Oid | dboid, | ||
Oid | spcoid, | ||
RelFileNumber | relfilenumber, | ||
ForkNumber | forknum, | ||
unsigned | segno, | ||
size_t | size, | ||
unsigned * | num_blocks_required, | ||
BlockNumber * | relative_block_numbers, | ||
unsigned * | truncation_block_length | ||
) |
Definition at line 667 of file basebackup_incremental.c.
References Assert, BACK_UP_FILE_FULLY, BACK_UP_FILE_INCREMENTALLY, BlockNumberIsValid(), BlockRefTableEntryGetBlocks(), BlockRefTableGetEntry(), IncrementalBackupInfo::brtab, IncrementalBackupInfo::buf, compare_block_numbers(), StringInfoData::data, RelFileLocator::dbOid, ereport, errcode(), errmsg_internal(), ERROR, FSM_FORKNUM, GetIncrementalFilePath(), i, MAIN_FORKNUM, IncrementalBackupInfo::manifest_files, OidIsValid, qsort, RelFileNumberIsValid, RelFileLocator::relNumber, size, and RelFileLocator::spcOid.
Referenced by sendDir().
char* GetIncrementalFilePath | ( | Oid | dboid, |
Oid | spcoid, | ||
RelFileNumber | relfilenumber, | ||
ForkNumber | forknum, | ||
unsigned | segno | ||
) |
Definition at line 627 of file basebackup_incremental.c.
References Assert, GetRelationPath(), INVALID_PROC_NUMBER, pfree(), and psprintf().
Referenced by GetFileBackupMethod().
size_t GetIncrementalFileSize | ( | unsigned | num_blocks_required | ) |
Definition at line 899 of file basebackup_incremental.c.
References Assert, and GetIncrementalHeaderSize().
Referenced by sendDir().
size_t GetIncrementalHeaderSize | ( | unsigned | num_blocks_required | ) |
Definition at line 871 of file basebackup_incremental.c.
References Assert.
Referenced by GetIncrementalFileSize().
void PrepareForIncrementalBackup | ( | IncrementalBackupInfo * | ib, |
BackupState * | backup_state | ||
) |
Definition at line 265 of file basebackup_incremental.c.
References Assert, backup_state, TimeLineHistoryEntry::begin, BlockRefTableMarkBlockModified(), BlockRefTableReaderGetBlocks(), BlockRefTableReaderNextRelation(), BlockRefTableSetLimitBlock(), BLOCKS_PER_READ, IncrementalBackupInfo::brtab, IncrementalBackupInfo::buf, CreateBlockRefTableReader(), StringInfoData::data, DEBUG1, DestroyBlockRefTableReader(), TimeLineHistoryEntry::end, ereport, errcode(), errdetail(), errhint(), errmsg(), errmsg_internal(), ERROR, expectedTLEs, WalSummaryIO::file, FileClose(), FilePathName(), WalSummaryIO::filepos, FilterWalSummaries(), GetWalSummaries(), i, InvalidXLogRecPtr, BackupState::istartpoint, BackupState::istarttli, lfirst, list_concat(), list_length(), list_nth(), LSN_FORMAT_ARGS, IncrementalBackupInfo::manifest_wal_ranges, IncrementalBackupInfo::mcxt, MemoryContextSwitchTo(), NIL, OpenWalSummaryFile(), palloc0(), range(), readTimeLineHistory(), ReadWalSummary(), ReportWalSummaryError(), BackupState::startpoint, BackupState::starttli, TimeLineHistoryEntry::tli, WaitForWalSummarization(), WalSummariesAreComplete(), and XLogRecPtrIsInvalid.
Referenced by perform_base_backup().