-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get the correct increment backup #176
Changes from 8 commits
2481dc0
2b2078d
6d74b7f
48008dc
66f4099
4aa9439
84619bc
24fd3b4
3372846
e911da8
b5e24ba
dabee15
5099504
b813cb9
6a4007b
7aa3475
1435b92
e197388
cf92d36
aa2e6c4
482dbb6
5b95534
17ac111
a23a8ea
622c787
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt) | |
pgBackup *prev_backup; | ||
|
||
/* find last completed database backup */ | ||
prev_backup = catalog_get_last_full_backup(backup_list); | ||
prev_backup = catalog_get_last_data_backup(backup_list); | ||
if (prev_backup == NULL) | ||
{ | ||
if (current.full_backup_on_error) | ||
|
@@ -185,14 +185,18 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt) | |
/* | ||
* To take incremental backup, the file list of the latest validated | ||
* full database backup is needed. | ||
* There a problem of increment backup. | ||
* IF a physical backup file is deleted(rm command, etc.) other than the pg_rman delete command of pg_rman, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IF is capital. Is it intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'll happen even if using pg_rman delete command. The delete command has the dangerous '--force' option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for you comment. I already fix it.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. |
||
* It cannot find the correct status of a full backup and incremental backup. | ||
* we need to discuss it later to resolve this problem. | ||
*/ | ||
if (current.backup_mode < BACKUP_MODE_FULL) | ||
{ | ||
pgBackup *prev_backup; | ||
uint32 xlogid, xrecoff; | ||
|
||
/* find last completed database backup */ | ||
prev_backup = catalog_get_last_full_backup(backup_list); | ||
prev_backup = catalog_get_last_data_backup(backup_list); | ||
if (prev_backup == NULL || prev_backup->tli != current.tli) | ||
{ | ||
if (current.full_backup_on_error) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,7 +266,7 @@ catalog_get_backup_list(const pgBackupRange *range) | |
* Find the last completed database full valid backup from the backup list. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about adding a comment so that you can specify that the problem still exists? |
||
pgBackup * | ||
catalog_get_last_full_backup(parray *backup_list) | ||
catalog_get_last_data_backup(parray *backup_list) | ||
{ | ||
int i; | ||
pgBackup *backup = NULL; | ||
|
@@ -276,9 +276,8 @@ catalog_get_last_full_backup(parray *backup_list) | |
{ | ||
backup = (pgBackup *) parray_get(backup_list, i); | ||
|
||
/* Return the first full valid backup. */ | ||
if (backup->backup_mode == BACKUP_MODE_FULL && | ||
backup->status == BACKUP_STATUS_OK) | ||
/* we need completed database backup */ | ||
if (backup -> status == BACKUP_STATUS_OK && HAVE_DATABASE(backup)) | ||
return backup; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,20 @@ pg_rman show detail -B ${BACKUP_PATH} > ${TEST_BASE}/TEST-0011.log 2>&1 | |
grep OK ${TEST_BASE}/TEST-0011.log | grep FULL | wc -l | ||
grep ERROR ${TEST_BASE}/TEST-0011.log | grep ARCH | wc -l | ||
|
||
echo '###### BACKUP COMMAND TEST-0009 ######' | ||
echo '###### BACKUP COMMAND TEST-0009 #######' | ||
echo '###### confirm incremental backup is right #######' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it better to change from "is right" to "works"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for you comment. I already fix it.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
init_catalog | ||
pg_rman backup -B ${BACKUP_PATH} -b full -p ${TEST_PGPORT} -d postgres --quiet;echo $? | ||
pg_rman validate -B ${BACKUP_PATH} --quiet | ||
pgbench -i -s 50 -d postgres > ${TEST_BASE}/pgbench.log 2>&1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you set the scale factor as 50? If you can, I think It's better to use a smaller value because the test execution time can be shortened. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. |
||
pg_rman backup -B ${BACKUP_PATH} -b incremental -p ${TEST_PGPORT} -d postgres --quiet;echo $? | ||
pg_rman validate -B ${BACKUP_PATH} --quiet | ||
pg_rman backup -B ${BACKUP_PATH} -b incremental -p ${TEST_PGPORT} -d postgres --quiet;echo $? | ||
pg_rman validate -B ${BACKUP_PATH} --quiet | ||
pg_rman show detail -B ${BACKUP_PATH} > ${TEST_BASE}/TEST-0012.log 2>&1 | ||
grep -c 16kB ${TEST_BASE}/TEST-0012.log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to check more precisely. Why don't you check each size of data, arclog, and srvlog? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the size of the data can be bigger or smaller in the future, is it better to check with a certain range of data size? For example, check if more than 20kB and less than 30kB. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In many environments, I confirmed that the acquired data size is 16kB when there is no update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's OK since this seems to be related to pg_rman's code. |
||
|
||
echo '###### BACKUP COMMAND TEST-0010 ######' | ||
echo '###### failure in backup with different system identifier database ######' | ||
init_catalog | ||
pg_ctl stop -m immediate > /dev/null 2>&1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There "is" a ? I think it's better to refer to the issue number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for you comment. I already fix it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!