Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PGPRO-5691] move mmapped ptrack map into shared postgres memory#19

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kulaginm merged 6 commits intomasterfrompgpro-5691
Feb 28, 2022

Conversation

kulaginm
Copy link
Member

No description provided.

@kulaginmkulaginm marked this pull request as draftFebruary 8, 2022 08:06
@kulaginmkulaginm marked this pull request as ready for reviewFebruary 9, 2022 07:10
@kulaginm
Copy link
MemberAuthor

Вопрос ревьюирам: как думаете, нужно ли удалять строку
ok(! -f $node->data_dir . "/global/ptrack.map.mmap", "ptrack.map.mmap should be cleaned up");
из tap теста?

Comment on lines -522 to -530
/*
* XXX: for some reason assign_ptrack_map_size is called twice during the
* postmaster boot! First, it is always called with bootValue, so we use
* -1 as default value and no-op here. Next, it is called with the actual
* value from config. That way, we use 0 as an option for user to turn
* off ptrack and clean up all files.
*/
if (newval == -1)
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it not a problem anymore? I see you use 0 as a boot value and clean up files when ptrack_map_size == 0

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We now do nothing (with files and memory) inside assign_ptrack_map_size() and use the value of ptrack_map_size after the re-assignment has passed.

Well, at least that's how I understand it.

@ololobus
Copy link
Contributor

ok(! -f $node->data_dir . "/global/ptrack.map.mmap", "ptrack.map.mmap should be cleaned up");

Yeah, you don't write this file, so I don't think that we need this check in tests anymore

* fix tap test (remove checking of ptrack.map.mmap file)* cosmetic change (minimize diff with master)
engine.c Outdated
elog(ERROR, "ptrack read map: unexpected end of file while reading map file \"%s\", expected to read %zu, but read only %zu bytes",
ptrack_path, PtrackActualSize, readed);
}
else if (last_readed < 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Надо на EINTR проверить. И...

Посмотрел на искось код постгресса, практически везде просто делают continue. Т.е. ни какой специальной реакции типа CHECK_FOR_INTERRUPTS обычно нет.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Добавил проверку EINTR. CHECK_FOR_INTERRUPTS не добавлял.
Заодно убрал дублирующее readed += last_readed, которое каким-то чудом проскочило через предыдущие запуски тестов.

engine.c Outdated

#ifdef WIN32
/* Check ptrack version inside old ptrack map */
if (ptrack_map->version_num < PTRACK_COMPATIBLE_VERSION_NUM)
Copy link
Contributor

Choose a reason for hiding this comment

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

Здесь, думаю, всё-таки нужно!= : вдруг следующая версия будет с багом, и кто-нибудь решит сдаунгрейдиться.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

исправил

engine.c Outdated
* Unconditionally update version
* This is usefull if we have read early compatible version of map
*/
ptrack_map->version_num = PTRACK_VERSION_NUM;
Copy link
Contributor

Choose a reason for hiding this comment

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

А почему не PTRACK_COMPATIBLE_VERSION_NUM ?
Соответственно, это нужно только подif (is_new_map)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

исправил

if (ptrack_map_size != 0)
RequestAddinShmemSpace(PtrackActualSize);
else
ptrackCleanFiles();
Copy link
Contributor

Choose a reason for hiding this comment

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

А к этому моменту уже был позван assign_ptrack_map_size ?

kulaginm added a commit to postgrespro/pg_probackup that referenced this pull requestFeb 12, 2022
#471)* [PGPRO-5691] ptrack-2.3: move mmapped ptrack map into shared postgres memoryIn ptrack-2.3 ptrack.map.mmap will be removed and 'incorrect checksum' errorwill not be fatal (postgrespro/ptrack#19)* added test_corrupt_ptrack_map test compatibility with both version 2.2 and version 2.3 of ptrack
@codecov
Copy link

codecovbot commentedFeb 12, 2022
edited
Loading

Codecov Report

Merging#19 (8b30346) intomaster (2f15771) willincrease coverage by0.52%.
The diff coverage is78.78%.

Impacted file tree graph

@@            Coverage Diff             @@##           master      #19      +/-   ##==========================================+ Coverage   88.55%   89.07%   +0.52%==========================================  Files           2        2                Lines         428      421       -7     ==========================================- Hits          379      375       -4+ Misses         49       46       -3
Impacted FilesCoverage Δ
engine.c85.22% <75.00%> (+0.57%)⬆️
ptrack.c92.66% <88.88%> (-0.34%)⬇️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update2f15771...8b30346. Read thecomment docs.

@kulaginmkulaginm merged commita0d5a20 intomasterFeb 28, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ololobusololobusololobus left review comments

@funny-falconfunny-falconfunny-falcon approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@kulaginm@ololobus@funny-falcon

[8]ページ先頭

©2009-2025 Movatter.jp