Skip to content
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

fix issue 149 and 150 #151

Closed
wants to merge 1 commit into from
Closed

fix issue 149 and 150 #151

wants to merge 1 commit into from

Conversation

huangfumingyue
Copy link
Contributor

@MoonInsung MoonInsung assigned MoonInsung and unassigned MoonInsung Apr 21, 2021
@MoonInsung
Copy link
Contributor

Dear huangfumingyue.

Thank you for responding to this issue.

Sorry, but could you write the two issues in separate PRs?
And please explain the code a little bit.

Best regards.
Moon.

Copy link
Contributor

@mikecaat mikecaat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work!

Now, I have three comments for your patches
One comment related to #150 needs to be discussed.

@@ -1091,11 +1091,12 @@ confirm_block_size(const char *name, int blcksz)
else if (strcmp(name, "wal_block_size") == 0)
elog(DEBUG, "wal block size is %d", block_size);

PQclear(res);
//PQclear(res);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think to remove this line is ok.

@@ -192,7 +192,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
uint32 xlogid, xrecoff;

/* find last completed database backup */
prev_backup = catalog_get_last_full_backup(backup_list);
Copy link
Contributor

@mikecaat mikecaat May 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #150, I think it's enough to undo "backup.c", "catalog.c" and "pg_rman.h" of this change .

Your patches check if the full backup exists or not, but this can't solve the meaningless incremental backup issue anyway. If my understanding is right, #154 should be handled if to solve the issue. So, I think it's better that your patches focus to solve the differential backup problem only. #154 will solve the meaningless incremental backup issue.

But, adding a test case is necessary to prevent this degradation for the future. pg_rman supports full backup and incremental backup, not differential backup. So I think we need to check it. Although there may be a better way, I came up with the following test case.

  1. get full backup
  2. pgbench and store enough data. For example, execute "pg_bench -i -s 50".
  3. get incremental backup
  4. get incremental backup

If incremental backup works, 3's backup's data size is big because 2's data is stored, but 4's backup's data is small.
In my environment, the following is the result.

a. differential backup
This is the result when using "REL_13_STABLE" branch.
Because the differential backup is got, the third backup size is big(798MB). I think the reason why the third one(798MB) is smaller than the second one(1435MB) is WAL archive data is not stored in the third one.

> pg_rman show 
=====================================================================
 StartTime           EndTime              Mode    Size   TLI  Status
=====================================================================
2021-05-13 09:20:50  2021-05-13 09:20:52  INCR   798MB     1  OK
2021-05-13 09:20:33  2021-05-13 09:20:38  INCR  1435MB     1  OK
2021-05-13 09:19:29  2021-05-13 09:19:31  FULL    49MB     1  OK

b. incremental backup
This is the result when using "REL_13_STABLE" branch and revert 447c19a.
Since this is an incremental backup, the third one is very small(33MB).

> pg_rman show 
=====================================================================
 StartTime           EndTime              Mode    Size   TLI  Status
=====================================================================
2021-05-13 09:27:00  2021-05-13 09:27:03  INCR    33MB     1  OK
2021-05-13 09:26:41  2021-05-13 09:26:45  INCR  1435MB     1  OK
2021-05-13 09:26:04  2021-05-13 09:26:06  FULL    49MB     1  OK

Though?

if ((endp && *endp) || block_size != blcksz)
ereport(ERROR,
(errcode(ERROR_PG_INCOMPATIBLE),
errmsg("%s(%d) is not compatible(%d expected)", name, block_size, blcksz)));
PQclear(res);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this patch needs to remove two branks before PQclear(res).

@MoonInsung
Copy link
Contributor

Dear all.
Sorry.
As the discussion is currently under way at #176, I will close this PR.

Best regards.
Moon.

@MoonInsung MoonInsung closed this May 27, 2021
@mikecaat mikecaat deleted the kouho branch December 14, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants