Skip to content
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

[FLASH-530] Reclaim obsolete meta file in PageStorage #369

Merged
merged 13 commits into from
Feb 3, 2020
Merged

[FLASH-530] Reclaim obsolete meta file in PageStorage #369

merged 13 commits into from
Feb 3, 2020

Conversation

leiysky
Copy link
Contributor

@leiysky leiysky commented Dec 25, 2019

We can safely remove neighbouring meta files if they are both legacy.

@leiysky leiysky changed the title [FLASH-530] Reclaim obsolete meta file in PageStorage WIP: [FLASH-530] Reclaim obsolete meta file in PageStorage Dec 29, 2019
@leiysky leiysky changed the title WIP: [FLASH-530] Reclaim obsolete meta file in PageStorage [FLASH-530] Reclaim obsolete meta file in PageStorage Jan 6, 2020
dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
@@ -17,7 +18,7 @@ extern const int LOGICAL_ERROR;
} // namespace ErrorCodes

std::set<PageFile, PageFile::Comparator>
PageStorage::listAllPageFiles(const String & storage_path, bool remove_tmp_file, bool ignore_legacy, Logger * page_file_log)
PageStorage::listAllPageFiles(const String & storage_path, Poco::Logger * page_file_log, ListPageFilesOption option)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add some tests for this function.

listAllPageFiles(const String & storage_path, bool remove_tmp_file, bool ignore_legacy, Poco::Logger * page_file_log);
listAllPageFiles(const String & storage_path, Poco::Logger * page_file_log, ListPageFilesOption option = ListPageFilesOption());

static std::optional<PageFile> tryGetLastSnapshot(const String & storage_path, Poco::Logger * page_file_log, bool remove_old = false);
Copy link
Contributor

@JaySon-Huang JaySon-Huang Jan 16, 2020

Choose a reason for hiding this comment

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

tryGetLastSnapshot here is easily confuse with getSnapshot, maybe Checkpoint for PageFile is better?

Copy link
Contributor

Choose a reason for hiding this comment

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

And also replace these "snapshot" with "checkpoint".
PageFile::Type::Snapshot, PageFile::folder_prefix_snapshot, PageStorage::ListPageFilesOption::ignore_snapshot

dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
leiysky and others added 13 commits January 31, 2020 23:32
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: leiysky <leiysky@outlook.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang
Copy link
Contributor

/run-integration-tests

3 similar comments
@JaySon-Huang
Copy link
Contributor

/run-integration-tests

@JaySon-Huang
Copy link
Contributor

/run-integration-tests

@JaySon-Huang
Copy link
Contributor

/run-integration-tests

Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

@JaySon-Huang JaySon-Huang merged commit 19fcaa7 into pingcap:DeltaMergeEngine Feb 3, 2020
@JaySon-Huang JaySon-Huang deleted the feature/pagefile-meta-gc branch February 12, 2020 03:38
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