pingcap / tispark

TiSpark is built for running Apache Spark on top of TiDB/TiKV
Apache License 2.0
884 stars 244 forks source link

Support probe tiflash status #2619

Closed shiyuhang0 closed 1 year ago

shiyuhang0 commented 1 year ago

What problem does this PR solve?

Support probe TiFlash status.

When you have two TiFlash and suspend one during the job, the suspended TiFlash can still be chosen and the request to it will wait for a timeout for grpc. It wastes resources and affected the whole job's speed.

What is changed and how it works?

When we choose the TiFlash. we call the isalive to probe the status of TiFlash. If it is not ready, drop the task.

Alternatives

In this pr, a background thread poll will refresh the cache of TiFlash store status every time a region task has been generated. Then drop the task whose store is unavailable. The cons are if there are many tasks, the thread poll will be distributed too much probe tasks.

Another way is to use a corn job to refresh the cache:

  1. Define a Storeclient/HTTP that need not the region. (RegionStoreClien need region which we can not provide)
  2. Then use pdclient to query all the stores and choose the TiFlash stores.
  3. Use Storeclient/HTTP to call is probe method to detect the tiflash status.
ti-chi-bot commented 1 year ago

[REVIEW NOTIFICATION]

This pull request has been approved by:

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.
shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/run-all-tests

shiyuhang0 commented 1 year ago

/merge

ti-chi-bot commented 1 year ago

This pull request has been accepted and is ready to merge.

Commit hash: eba2936f55f57300fe90722f9188979fd2b6c025

ti-chi-bot commented 1 year ago

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