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

Đang mở Phù hợp với người mới
#13,165 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Đọc xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java ở phần xử lý tỷ lệ lỗi, sau đó so sánh hành vi khi giá trị chưa được đặt với cách xử lý tỷ lệ thành công ở phía trên và đặc tả A50 được liên kết trong issue. Cập nhật giá trị mặc định của tỷ lệ lỗi để khớp với đặc tả, đồng thời xác minh rằng giá trị chưa được đặt sẽ vô hiệu hóa việc loại bỏ dựa trên tỷ lệ lỗi, còn các giá trị được chỉ định rõ vẫn giữ nguyên hành vi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 {
  // ...
Ngôn ngữ chính
Java
Star
12.1k
Fork
4k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của grpc/grpc-java

Tất cả issue của grpc/grpc-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.