-
Notifications
You must be signed in to change notification settings - Fork 86
[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
Conversation
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"); |
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.
Не понимаю новое сообщение
src/catchup.c
Outdated
|
||
/* shrink dest pgdata list */ | ||
pgFileFree(file); | ||
if (!dry_run) | ||
pgFileFree(file); |
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.
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) |
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.
Так я думаю, что как раз это-то можно и не пропускать, потому что этот вызов ничего не меняет в данных
tests/catchup.py
Outdated
) | ||
|
||
# compare data dirs before and after cathup | ||
# self.compare_pgdata( |
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.
А зачем этот закомментаренный кусок кода нужен?
245e3cd
to
448efc2
Compare
src/catchup.c
Outdated
source_node_info.ptrack_schema, | ||
source_node_info.ptrack_version_num, | ||
dest_redo.lsn); | ||
source_node_info.ptrack_schema, |
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.
оформление: зачем-то появились три лишних табуляции.
src/catchup.c
Outdated
if (!dry_run) | ||
{ | ||
fio_delete(file->mode, fullpath, FIO_LOCAL_HOST); | ||
elog(VERBOSE, "Deleted file \"%s\"", fullpath); |
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.
Сообщение надо оставить
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) |
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.
придирка: необязательно проверять условие в цикле, когда можно весь цикл вынести под условие
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); 8000 td> |
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.
Получается что тут память утекает?
Add dry-run option for catchup