Outlier detection: unset `failure_percent_ejection` results in 100% instead of 0%

オープン 初心者向け
#13,165 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java

調査の方向性

xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.javaで失敗率の処理箇所を読み、未設定時の動作を、その上にある成功率の処理およびissueにリンクされたA50仕様と比較してください。失敗率のデフォルト値を仕様に合わせて更新し、値が未設定の場合は失敗率による排除が無効になり、明示的に値を指定した場合は従来の動作が維持されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

success_rate_ejection.enforcement_percentage defaults to 100% per Envoy and our spec:

https://github.com/grpc/proposal/blob/4125fbd155353d35386d8fbd6b23454f6ab0e345/A50-xds-outlier-detection.md?plain=1#L72-L75

This is implemented (correctly) here:

https://github.com/grpc/grpc-java/blob/ed3bf6b76b65fc76c1669ef70b71765844eb8a50/xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java#L379-L396

But failure_percent_ejection should default to zero instead (i.e. disable checking when unset):

https://github.com/grpc/proposal/blob/4125fbd155353d35386d8fbd6b23454f6ab0e345/A50-xds-outlier-detection.md?plain=1#L148

This is implemented (incorrectly) here:

https://github.com/grpc/grpc-java/blob/ed3bf6b76b65fc76c1669ef70b71765844eb8a50/xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java#L398-L414

Note that it's a copy/paste of the enforcement_percentage above it, meaning it is only disabled if it is explicitly set to zero.

When we go to actually build the enforcer, failurePercentage is non-null:

https://github.com/grpc/grpc-java/blob/ed3bf6b76b65fc76c1669ef70b71765844eb8a50/xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java#L632-L652

But enforcement percentage is null, so the default percentage of 100 is applied:

https://github.com/grpc/grpc-java/blob/ed3bf6b76b65fc76c1669ef70b71765844eb8a50/util/src/main/java/io/grpc/util/OutlierDetectionLoadBalancer.java#L1116-L1121

The fix appears to be trivial. In EnvoyServerProtoData.java, change the check to:

if (!envoyOutlierDetection.hasEnforcingFailurePercentage()
    || envoyOutlierDetection.getEnforcingFailurePercentage().getValue() == 0) {
  failurePercentageEjection = null;
} else {
  // ...
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 4時間
マージ済み PR(30日)
43

環境構築

はじめの一歩

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

grpc/grpc-java のほかの issue

grpc/grpc-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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