8000 [pbckp-128] dry-run option for catchup by dlepikhova · Pull Request #477 · postgrespro/pg_probackup · GitHub
[go: up one dir, main page]

Skip to content

[pbckp-128] dry-run option for catchup #477

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

Merged
merged 14 commits into from
Jun 1, 2022

Conversation

dlepikhova
Copy link
Contributor

Add dry-run option for catchup

@dlepikhova dlepikhova requested a review from kulaginm March 18, 2022 15:09
src/catchup.c Outdated
@@ -901,7 +909,7 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
*/
if (current.backup_mode != BACKUP_MODE_FULL)
{
elog(INFO, "Removing redundant files in destination directory");
elog(INFO, "Redundant files %s in destination directory", dry_run ? "can" : "will");
Copy link
Member

Choose a reason for hiding this comment

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

Не понимаю новое сообщение

src/catchup.c Outdated
8000

/* shrink dest pgdata list */
pgFileFree(file);
if (!dry_run)
pgFileFree(file);
Copy link
Member

Choose a reason for hiding this comment

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

pgFileFree -- это же про освобождение памяти, зачем его пропускать?

src/ptrack.c Outdated
@@ -260,8 +260,9 @@ make_pagemap_from_ptrack_2(parray *files,
page_map_entry *dummy_map = NULL;

/* Receive all available ptrack bitmaps at once */
filemaps = pg_ptrack_get_pagemapset(backup_conn, ptrack_schema,
ptrack_version_num, lsn);
if (!dry_run)
Copy link
Member

Choose a reason for hiding this comment

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

Так я думаю, что как раз это-то можно и не пропускать, потому что этот вызов ничего не меняет в данных

tests/catchup.py Outdated
)

# compare data dirs before and after cathup
# self.compare_pgdata(
Copy link
Member

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.

А зачем этот закомментаренный кусок кода нужен?

@kulaginm kulaginm added this to the 2.5.6 milestone Mar 31, 2022
@dlepikhova dlepikhova changed the base branch from master to release_2_5_6 March 31, 2022 08:23
@dlepikhova dlepikhova force-pushed the release_2_5_6_PBCKP-128 branch from 245e3cd to 448efc2 Compare April 22, 2022 11:35
src/catchup.c Outdated
source_node_info.ptrack_schema,
source_node_info.ptrack_version_num,
dest_redo.lsn);
source_node_info.ptrack_schema,
Copy link
Member

Choose a reason for hiding this comment

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

оформление: зачем-то появились три лишних табуляции.

src/catchup.c Outdated
if (!dry_run)
{
fio_delete(file->mode, fullpath, FIO_LOCAL_HOST);
elog(VERBOSE, "Deleted file \"%s\"", fullpath);
Copy link
Member

Choose a reason for hiding this comment

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

Сообщение надо оставить

src/catchup.c Outdated
@@ -509,14 +509,18 @@ catchup_multithreaded_copy(int num_threads,
threads = (pthread_t *) palloc(sizeof(pthread_t) * num_threads);
for (i = 0; i < num_threads; i++)
{
elog(VERBOSE, "Start thread num: %i", i);
pthread_create(&threads[i], NULL, &catchup_thread_runner, &(threads_args[i]));
if (!dry_run)
Copy link
Member

Choose a reason for hiding this comment

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

придирка: необязательно проверять условие в цикле, когда можно весь цикл вынести под условие

src/catchup.c Outdated
pg_stop_backup_write_file_helper(dest_pgdata, PG_BACKUP_LABEL_FILE, "backup label",
stop_backup_result.backup_label_content, stop_backup_result.backup_label_content_len,
NULL);
free(stop_backup_result.backup_label_content);
Copy link
Member

Choose a reason for hiding this comment

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

Получается что тут память утекает?

@kulaginm kulaginm changed the title pbckp 128 [pbckp-128] dry-run option for catchup May 26, 2022
@kulaginm kulaginm merged commit 884e8b0 into release_2_5_6 Jun 1, 2022
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.

2 participants
0