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

Lightning : make pebbleDB block size configurable #49514

Merged
merged 14 commits into from
Jan 3, 2024
Merged

Lightning : make pebbleDB block size configurable #49514

merged 14 commits into from
Jan 3, 2024

Conversation

mittalrishabh
Copy link
Contributor

@mittalrishabh mittalrishabh commented Dec 16, 2023

What problem does this PR solve?

Issue Number: close #45037

Problem Summary:
We have seen that lightning is bounded by EBS IOPS which is 16k and is taking more than 3 hours to transfer 7 TB of data.

What changed and how does it work?

I have made the block size configurable through lightning config. We are setting it 128k internally.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Its running in production with 128k size. However, i haven't tested the master code. I am relying on pingcap CI to test it.
Side effects

I haven't seen much increase in memory and CPU after increasing the block size.
Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Dec 16, 2023
Copy link

ti-chi-bot bot commented Dec 16, 2023

Hi @mittalrishabh. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

tiprow bot commented Dec 16, 2023

Hi @mittalrishabh. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mittalrishabh mittalrishabh changed the title make pebbleDB block size configurable Lightning : make pebbleDB block size configurable Dec 16, 2023
@lance6716
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Dec 16, 2023
@lance6716
Copy link
Contributor

/cc @lyzx2001

@ti-chi-bot ti-chi-bot bot requested a review from lyzx2001 December 16, 2023 12:38
Copy link

codecov bot commented Dec 16, 2023

Codecov Report

Merging #49514 (b647d7e) into master (999f599) will decrease coverage by 3.2133%.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49514        +/-   ##
================================================
- Coverage   72.0620%   68.8487%   -3.2133%     
================================================
  Files          1438       1440         +2     
  Lines        345762     407290     +61528     
================================================
+ Hits         249163     280414     +31251     
- Misses        76461     107965     +31504     
+ Partials      20138      18911      -1227     
Flag Coverage Δ
integration 43.8687% <0.0000%> (?)
unit 72.0505% <ø> (-0.0115%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 56.3129% <ø> (ø)
parser ∅ <ø> (∅)
br 44.1967% <0.0000%> (-7.5061%) ⬇️

@wuhuizuo
Copy link
Contributor

/retest

@lance6716

This comment was marked as resolved.

Copy link
Contributor

@lyzx2001 lyzx2001 left a comment

Choose a reason for hiding this comment

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

also need to add the code to check whether BlockSize is valid before using it

br/pkg/lightning/backend/local/engine.go Outdated Show resolved Hide resolved
br/pkg/lightning/config/config.go Outdated Show resolved Hide resolved
@lyzx2001

This comment was marked as resolved.

@lyzx2001
Copy link
Contributor

/cc @lance6716

@ti-chi-bot ti-chi-bot bot requested a review from lance6716 December 18, 2023 06:23
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 18, 2023
@lance6716
Copy link
Contributor

/test pull-lightning-integration-test

Copy link

tiprow bot commented Dec 20, 2023

@lance6716: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-lightning-integration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

@@ -1457,6 +1459,7 @@ func NewConfig() *Config {
DiskQuota: ByteSize(math.MaxInt64),
DuplicateResolution: DupeResAlgNone,
PausePDSchedulerScope: PausePDSchedulerScopeTable,
BlockSize: 8192,
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to keep compatibility, we should use the old effective value 16 * 1024, as in newSSTWriter from backend/local/engine.go line 1377

pkg/ddl/ingest/config.go Outdated Show resolved Hide resolved
pkg/executor/importer/table_import.go Outdated Show resolved Hide resolved
br/pkg/lightning/config/config.go Outdated Show resolved Hide resolved
Copy link

ti-chi-bot bot commented Jan 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, tangenta, ywqzzy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lance6716
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 3, 2024
@lance6716
Copy link
Contributor

/test pull-lightning-integration-test

Copy link

tiprow bot commented Jan 3, 2024

@lance6716: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test pull-lightning-integration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot merged commit 89fc440 into pingcap:master Jan 3, 2024
18 checks passed
@Benjamin2037 Benjamin2037 added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Mar 20, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 20, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #51931.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ligthtning : Increase io size(BlockSize) of pebble DB
8 participants