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

Support multi-disks for RegionPersister #1199

Merged
merged 9 commits into from
Nov 11, 2020

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Nov 4, 2020

Signed-off-by: JaySon-Huang tshent@qq.com

What problem does this PR solve?

Issue Number: a part of #1128

Problem Summary:

What is changed and how it works?

  • Add PSDiskDelegatorRaft for managing the disks of Raft data
  • The configuration "raft.kvstore_path" accept multi-disk separated by ','. If it is empty, it will be generated from latest_data_path
  • Add a new configuration "raft.enable_storage_compatibility_mode". It is true by default.
    • Detect PageFile's binary version
      • If there is data with the old version, run in compatibility_mode (DB::stable::PageStorage)
      • Otherwise, use the latest DB::PageStorage
  • If "raft.enable_storage_compatibility_mode" is set to false, then always use the latest DB::PageStorage

Related changes

  • Need to cherry-pick to the release branch 4.0

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
    • Deploy a cluster with version v4.0.7, load TPC-H 1, upgrade TiFlash node, run TPC-H queries, all is fine. Then load another TPC-H 1, run TPC-H queries, all is fine.

Side effects

  • N/A

Release note

  • Support multi-disks for storing Raft data

@JaySon-Huang JaySon-Huang added the type/new-feature Issue or PR for new feature label Nov 4, 2020
@JaySon-Huang JaySon-Huang self-assigned this Nov 4, 2020
@JaySon-Huang JaySon-Huang changed the title Support multi-disks for RegionPersister [WIP] Support multi-disks for RegionPersister Nov 4, 2020
@JaySon-Huang JaySon-Huang force-pushed the refine_region_persister branch 3 times, most recently from 64a52fb to 2744864 Compare November 5, 2020 07:01
@JaySon-Huang JaySon-Huang changed the title [WIP] Support multi-disks for RegionPersister Support multi-disks for RegionPersister Nov 5, 2020
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

Comment on lines 43 to 45
auto p = Poco::Path{s + "/kvstore"}.toString();
if (p.back() == '/')
p.erase(p.begin() + p.size() - 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please put those lines into a function and call it. So do other places.

@JaySon-Huang
Copy link
Contributor Author

/rebuild

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@@ -245,6 +269,12 @@ TiFlashRaftConfig::TiFlashRaftConfig(const std::string & path, Poco::Util::Layer
ErrorCodes::INVALID_CONFIG_PARAMETER);
disable_bg_flush = true;
}

// just for test
if (config.has("raft.enable_compatibility_mode"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (config.has("raft.enable_compatibility_mode"))
if (config.has("raft.enable_compatible_mode"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, will solve it in the next PR.

Copy link
Contributor

@flowbehappy flowbehappy left a comment

Choose a reason for hiding this comment

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

LGTM with minor comment

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 11, 2020
@JaySon-Huang JaySon-Huang merged commit 6f04988 into pingcap:master Nov 11, 2020
@JaySon-Huang JaySon-Huang deleted the refine_region_persister branch November 11, 2020 05:18
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Nov 15, 2020
JaySon-Huang added a commit that referenced this pull request Nov 15, 2020
* Support multi-disks for PageStorage (#1156)
* Support multi-disks for RegionPersister (#1199)
* Refactor storage configuration and strategies for choosing paths with multi-disks (#1216)

Signed-off-by: JaySon-Huang <tshent@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1. type/new-feature Issue or PR for new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants