Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bc7231

Browse files
committed
add some comments for pg_probackup.h
1 parentcbcbf5f commit1bc7231

File tree

1 file changed

+32
-36
lines changed

1 file changed

+32
-36
lines changed

‎pg_probackup.h

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#defineDIR_PERMISSION(0700)
5252
#defineFILE_PERMISSION(0600)
5353

54+
/* 64-bit xid support for PGPRO_EE */
5455
#ifndefPGPRO_EE
5556
#defineXID_FMT "%u"
5657
#endif
@@ -67,32 +68,24 @@ typedef struct pgFile
6768
that the file existed but was not backed up
6869
because not modified since last backup. */
6970
pg_crc32crc;/* CRC value of the file, regular file only */
70-
char*linked;/* path of the linked file */
71+
char*linked;/* path of the linked file */
7172
boolis_datafile;/* true if the file is PostgreSQL data file */
7273
char*path;/* path of the file */
73-
char*ptrack_path;
74+
char*ptrack_path;/* path of the ptrack fork of the relation */
7475
intsegno;/* Segment number for ptrack */
75-
uint64generation;/* Generation of compressed file.
76-
* -1 for non-compressed files */
77-
intis_partial_copy;/* for compressed files.
78-
* 1 if backed up via copy_file_partly() */
79-
volatileuint32lock;
80-
datapagemap_tpagemap;
76+
uint64generation;/* Generation of the compressed file. Set to '-1'
77+
* for non-compressed files. If generation has changed,
78+
we cannot backup compressed file partially. */
79+
intis_partial_copy;/* for compressed files. Set to '1' if backed up
80+
* via copy_file_partly() */
81+
volatileuint32lock;/* lock for synchronization of parallel threads */
82+
datapagemap_tpagemap;/* bitmap of pages updated since previous backup */
8183
}pgFile;
8284

83-
#defineIsValidTime(tm)\
84-
((tm.tm_sec >= 0 && tm.tm_sec <= 60) &&/* range check for tm_sec (0-60) */ \
85-
(tm.tm_min >=0&&tm.tm_min <=59)&&/* range check for tm_min (0-59) */ \
86-
(tm.tm_hour >=0&&tm.tm_hour <=23)&&/* range check for tm_hour(0-23) */ \
87-
(tm.tm_mday >=1&&tm.tm_mday <=31)&&/* range check for tm_mday(1-31) */ \
88-
(tm.tm_mon >=0&&tm.tm_mon <=11)&&/* range check for tm_mon (0-23) */ \
89-
(tm.tm_year+1900 >=1900))/* range check for tm_year(70-) */
90-
9185
/* Effective data size */
9286
#defineMAPSIZE (BLCKSZ - MAXALIGN(SizeOfPageHeaderData))
9387

9488
/* Backup status */
95-
/* XXX re-order ? */
9689
typedefenumBackupStatus
9790
{
9891
BACKUP_STATUS_INVALID,/* the pgBackup is invalid */
@@ -113,47 +106,50 @@ typedef enum BackupMode
113106
BACKUP_MODE_FULL/* full backup */
114107
}BackupMode;
115108

116-
/*
117-
* pg_probackup takes backup into the directroy $BACKUP_PATH/<date>/<time>.
118-
*
119-
* status == -1 indicates the pgBackup is invalid.
120-
*/
109+
110+
/* special values of pgBackup fields */
111+
#defineKEEP_INFINITE(INT_MAX)
112+
#defineBYTES_INVALID(-1)
113+
121114
typedefstructpgBackup
122115
{
123-
/*Backup Level*/
116+
/*Mode - one of BACKUP_MODE_xxx above*/
124117
BackupModebackup_mode;
125118

126-
/* Status - one of BACKUP_STATUS_xxx */
119+
/* Status - one of BACKUP_STATUS_xxxabove*/
127120
BackupStatusstatus;
128121

129122
/* Timestamp, etc. */
130-
TimeLineIDtli;
131-
XLogRecPtrstart_lsn;
132-
XLogRecPtrstop_lsn;
133-
time_tstart_time;
134-
time_tend_time;
135-
time_trecovery_time;
136-
TransactionIdrecovery_xid;
137-
138-
/* Different sizes (-1 means nothing was backed up) */
123+
TimeLineIDtli;/* timeline of start and stop baskup lsns */
124+
XLogRecPtrstart_lsn;/* backup's starting transaction log location */
125+
XLogRecPtrstop_lsn;/* backup's finishing transaction log location */
126+
time_tstart_time;/* since this moment backup has status
127+
* BACKUP_STATUS_RUNNING */
128+
time_tend_time;/* the moment when backup was finished, or the moment
129+
* when we realized that backup is broken*/
130+
time_trecovery_time;/* FIXME */
131+
TransactionIdrecovery_xid;/* FIXME */
132+
139133
/*
140134
* Amount of raw data. For a full backup, this is the total amount of
141135
* data while for a differential backup this is just the difference
142136
* of data taken.
137+
* BYTES_INVALID means nothing was backed up.
143138
*/
144139
int64data_bytes;
145140

146141
/* data/wal block size for compatibility check */
147142
uint32block_size;
148143
uint32wal_block_size;
149144
uint32checksum_version;
145+
146+
/* TODO review the code below. */
150147
boolstream;
148+
/* Identifier of the previous backup.
149+
* Which is basic backup for current incremental backup. */
151150
time_tparent_backup;
152151
}pgBackup;
153152

154-
/* special values of pgBackup */
155-
#defineKEEP_INFINITE(INT_MAX)
156-
#defineBYTES_INVALID(-1)
157153

158154
typedefstructpgTimeLine
159155
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp