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: check write stall when switch-mode is disabled #40116

Closed
wants to merge 1 commit into from

Conversation

sleepymole
Copy link
Contributor

@sleepymole sleepymole commented Dec 22, 2022

What problem does this PR solve?

Issue Number: close #40163

Problem Summary:

Although TiKV checks write stall before ingesting, it doesn't work on the follower node of the region. https://github.com/tikv/tikv/blob/8864e9bac814554bbe4acaddd01282f5fdae3dae/src/import/sst_service.rs#L181. To avoid write stall on follower node, Lightning should also check write stall before ingesting data to each peer of the region.

What is changed and how it works?

When swtich-mode is disabled, we assume Lightning is importing to data to an online cluster. Then before ingesting, use an empty MultiIngestRequest to check whether ingesting may cause write stall on every peer of the region.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

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
Copy link
Member

ti-chi-bot commented Dec 22, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lance6716

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 22, 2022
@sleepymole sleepymole added component/lightning This issue is related to Lightning of TiDB. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 22, 2022
@sleepymole
Copy link
Contributor Author

sleepymole commented Dec 26, 2022

/hold

Need to think about how to add tests.

@sleepymole sleepymole marked this pull request as ready for review December 26, 2022 05:53
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 26, 2022
@sleepymole sleepymole added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 26, 2022
@lance6716
Copy link
Contributor

I added a unit test that verify MultiIngest to all peers is sent in #40228.

90a3c7a

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.

test is added in #40228

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 29, 2022
@sleepymole
Copy link
Contributor Author

@lance6716 It seems this PR can be replaced by #40228. I will close this PR. Please update the title and description of #40228.

@sleepymole sleepymole closed this Dec 29, 2022
@sleepymole sleepymole deleted the ingest-check branch December 29, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lightning should check write stall when importing data to online cluster
3 participants