Skip to content

Small fixes #546

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 5 commits into from
Oct 13, 2022
Merged

Small fixes #546

merged 5 commits into from
Oct 13, 2022

Conversation

funny-falcon
Copy link
Collaborator

No description provided.

@funny-falcon funny-falcon changed the base branch from master to REL_2_5 October 11, 2022 06:38
@@ -361,6 +361,7 @@ main(int argc, char *argv[])
elog(ERROR, "Version mismatch, pg_probackup binary with version '%s' "
"is launched as an agent for pg_probackup binary with version '%s'",
PROGRAM_VERSION, argv[2]);
remote_agent = true;
Copy link
Member

Choose a reason for hiding this comment

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

Я думаю тогда надо дочистить и упоминание условия в config_get_opt() (потому что в случае агента эта функция вроде и не вызывается).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

src/utils/file.c Outdated
@@ -3381,9 +3384,9 @@ fio_communicate(int in, int out)
case FIO_GET_CRC32:
/* calculate crc32 for a file */
if (hdr.arg == 1)
Copy link
Member

Choose a reason for hiding this comment

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

А это условие разве остаётся корректным после введения битовых флагов в arg?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

! Спасибо!

src/archive.c Outdated
@@ -761,8 +761,8 @@ push_file_internal_gz(const char *wal_file_name, const char *pg_xlog_dir,
pg_crc32 crc32_dst;

/* TODO: what if one of them goes missing? */
Copy link
Member

Choose a reason for hiding this comment

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

А что с этим комментарием? Он актуален?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Хороший вопрос: могут ли у нас под ногами удалить файл?
Думаю, пока можно "забить" и убрать комментарий.
В целом, даже если мы хотим передавать missing_ok=true , нужно различать "не существовавший" файл и файл с crc==0. Так что, придётся переделывать API.

@kulaginm
Copy link
Member

kulaginm commented Oct 11, 2022

По поводу введения set_forkname:
Первое, за что зацепился глаз -- это то, что функция глобальная, а мне кажется, что не надо выносить это за пределы src/dir.c.
Предлагаю рассматривать pgFileInit() как некоторый "конструктор" "объектов" pgFile и внести логику/вызов заполнения forkName внутрь этого "конструктора".
Тут остаётся вопрос с обработкой external_dir_num, вижу два варианта:
или заполнять поле forkName в любом случае (так как оно зависит от имени), а обработку external_dir_num оставить на внешнюю логику (которая пользуется pgFile)
или вообще сделать два "конструктора" pgFile, один для создания pgFile из файловой системы (из dir_check_file()), второй из бекапа (get_backup_filelist()).
В любом случае в функции get_backup_filelist() смесь логики чтения файла и заполнения внутренних полей pgFile мне кажется очень некрасивой, хотелось бы побольше убрать внутрь src/dir.c.
Но это моё имхо, что думаешь?

@funny-falcon funny-falcon requested a review from kulaginm October 11, 2022 12:16
@funny-falcon
Copy link
Collaborator Author

Рефакторинг инициализации pgFile выделен в отдельную задачу.

@funny-falcon
Copy link
Collaborator Author

test_basic_ptrack_truncate_replica - локально 20 минут гонял (~25 раз), ни разу не упал

@funny-falcon funny-falcon changed the base branch from REL_2_5 to master October 13, 2022 11:24
@funny-falcon funny-falcon merged commit 3c1fadc into master Oct 13, 2022
@Burus Burus added this to the 2.5.9 milestone Dec 21, 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.

3 participants