-
Notifications
You must be signed in to change notification settings - Fork 17
Resolve issues #5 and #1: reduce number of collisions in the ptrack map #6
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dd6fdc0
Resolve issue#5: store update_lsn of each block into two independent …
ololobus 829f96c
Resolve issue#1: add ptrack_get_change_stat().
ololobus 3026be9
Add new function ptrack_get_change_file_stat(start_lsn pg_lsn)
ololobus cf8e309
Slightly optimize ptrack_get_pagemapset
ololobus fbfba8c
Do a proper cleanup when ptrack.map version is incompatible
ololobus ab17447
Correct some typos
ololobus 9c132a3
Refactor stats API and remove ptrack_get_change_file_stat
ololobus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.deps | ||
*.so | ||
*.o | ||
ptrack--2.0.sql | ||
Dockerfile | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* ptrack/ptrack--2.1--2.2.sql */ | ||
|
||
-- Complain if script is sourced in psql, rather than via ALTER EXTENSION | ||
\echo Use "ALTER EXTENSION ptrack UPDATE;" to load this file.\ quit | ||
|
||
DROP FUNCTION ptrack_get_pagemapset(start_lsn pg_lsn); | ||
CREATE FUNCTION ptrack_get_pagemapset(start_lsn pg_lsn) | ||
RETURNS TABLE (path text, | ||
pagecount bigint, | ||
pagemap bytea) | ||
AS 'MODULE_PATHNAME' | ||
LANGUAGE C STRICT VOLATILE; | ||
|
||
CREATE FUNCTION ptrack_get_change_stat(start_lsn pg_lsn) | ||
RETURNS TABLE ( | ||
files bigint, | ||
pages numeric, | ||
"size, MB" numeric | ||
) AS | ||
$func$ | ||
DECLARE | ||
block_size bigint; | ||
BEGIN | ||
block_size := (SELECT setting FROM pg_settings WHERE name = 'block_size'); | ||
|
||
RETURN QUERY | ||
SELECT changed_files, | ||
changed_pages, | ||
block_size * changed_pages / (1024.0 * 1024) | ||
FROM | ||
(SELECT count(path) AS changed_files, | ||
sum(pagecount) AS changed_pages | ||
FROM ptrack_get_pagemapset(start_lsn)) s; | ||
END | ||
$func$ LANGUAGE plpgsql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Не могу найти, где делается unmap в этом случае?
При этом сразу после метки
ptrack_map_reinit
делаетсяdurable_unlink(ptrack_mmap_path)
.В итоге, этот файл повисает невидимкой в файловой системе, и в адрессном пространстве процесса повисает его mmap.
Наверное есть смысл позвать здесь
ptrackCleanFilesAndMap
?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.
Да, похоже на то. Я сомневался в этом месте, но потом забыл и не разобрался до конца