Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Distinguish high load and unavailability of TiDB

オープン
#282 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
go
領域
backend

調査の方向性

まず 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-shutdown can 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingcap/tiproxy のほかの issue

pingcap/tiproxy の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。