Distinguish high load and unavailability of TiDB
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず health-check と router の実装を読み、issue で説明されている 2 秒のタイムアウト、3 回のチェック失敗、接続の一斉移行に注目してください。2 つの TiDB インスタンスに対する高負荷シナリオを再現または検討し、そのうえで、graceful-wait-before-shutdown に違反することなく、一時的な遅延と利用不能を区別する動作を定義して検証してください。
索引モデルが issue の本文から書いたものです。
説明
Development Task
When the load of TiDB is very high, it may not respond within 2 seconds, and thus TiProxy treats it as down and migrates ALL connections away from it. The migration is typically very fast and may finish most of them before the next health check.
If there are 2 TiDB instances, A and B. The CPU usage of A is 100% and B is 90%. Theoretically, this may happen:
- TiProxy can not dial A within 2 seconds and treats A as down and B as alive
- TiProxy wants to migrate all connections from A to B
- After 3 seconds, the CPU usage of A becomes 90% and B becomes 100%
- Again, TiProxy thinks A is alive but B is down
- TiProxy wants to migrate all connections from B to A
This situation is just theoretically possible but I'm not sure if it will happen in the real world:
- If the CPU usage of A is 100%, is it possible to migrate many connections within 3 seconds?
- When the CPU usage of B becomes 100%, it's slow to dial B. Will the connection migration be that fast?
Anyway, the strategies of the health check and router are too aggressive:
- The health check treats the backend as down when it just fails in 2 seconds for 3 times. However, I also want to make the health check fast enough so that the
graceful-wait-before-shutdowncan be configured shorter. - The router tries to migrate all connections all at once. Exactly, 10ms for 10 connections and thus 3s for 3000 connections for each TiProxy. 3000 connections almost mean all the connections on one TiDB. However, I also want to make the migration ASAP because it needs to finish within
graceful-wait-before-shutdown.
- 主要言語
- Go
- スター
- 73
- フォーク
- 41
- 平均マージ
- 21時間 3分
- マージ済み PR(30日)
- 21
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pingcap/tiproxy のほかの issue
-
type/enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
severity/minor type/bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
type/bug
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
pingcap/tiproxy の issue をすべて見る
似ている issue
-
enhancement low priority
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
eugenioenko/ttt#674 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
vavallee/bindery#2793 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信