From 4f15d3dcf959d74e69aa3223f41c0be385d188e0 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Mon, 12 Dec 2022 14:26:27 -0800 Subject: [PATCH] Revert "xDS stateful session affinity: add config plumbing (#31827)" (#31873) This reverts commit f76948b12d9e853cea19bbafaf098533f6907d93. --- CMakeLists.txt | 56 --------- Makefile | 2 - build_autogenerated.yaml | 18 +-- config.m4 | 1 - config.w32 | 1 - gRPC-C++.podspec | 2 - gRPC-Core.podspec | 3 - grpc.gemspec | 2 - grpc.gyp | 1 - package.xml | 2 - src/core/BUILD | 2 - .../client_channel/lb_policy/xds/cds.cc | 9 +- .../lb_policy/xds/xds_cluster_resolver.cc | 18 +-- src/core/ext/xds/xds_cluster.cc | 33 ----- src/core/ext/xds/xds_cluster.h | 6 +- src/core/ext/xds/xds_endpoint.cc | 10 +- src/core/ext/xds/xds_health_status.cc | 75 ------------ src/core/ext/xds/xds_health_status.h | 78 ------------ src/core/lib/json/json_object_loader.cc | 10 -- src/core/lib/json/json_object_loader.h | 15 --- src/proto/grpc/testing/xds/v3/BUILD | 9 -- src/proto/grpc/testing/xds/v3/cluster.proto | 7 -- src/proto/grpc/testing/xds/v3/endpoint.proto | 29 ++++- .../grpc/testing/xds/v3/health_check.proto | 55 --------- src/python/grpcio/grpc_core_dependencies.py | 1 - test/core/json/json_object_loader_test.cc | 61 ---------- test/core/xds/BUILD | 1 - .../xds/xds_cluster_resource_type_test.cc | 58 --------- .../xds/xds_endpoint_resource_type_test.cc | 113 ------------------ .../end2end/xds/xds_cluster_end2end_test.cc | 2 +- test/cpp/end2end/xds/xds_end2end_test_lib.cc | 2 +- test/cpp/end2end/xds/xds_end2end_test_lib.h | 19 +-- .../end2end/xds/xds_ring_hash_end2end_test.cc | 10 +- tools/doxygen/Doxyfile.c++.internal | 2 - tools/doxygen/Doxyfile.core.internal | 2 - 35 files changed, 52 insertions(+), 663 deletions(-) delete mode 100644 src/core/ext/xds/xds_health_status.cc delete mode 100644 src/core/ext/xds/xds_health_status.h delete mode 100644 src/proto/grpc/testing/xds/v3/health_check.proto diff --git a/CMakeLists.txt b/CMakeLists.txt index bc696ef5103..d2980d57c78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -676,9 +676,6 @@ protobuf_generate_grpc_cpp_with_import_path_correction( protobuf_generate_grpc_cpp_with_import_path_correction( src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto ) -protobuf_generate_grpc_cpp_with_import_path_correction( - src/proto/grpc/testing/xds/v3/health_check.proto src/proto/grpc/testing/xds/v3/health_check.proto -) protobuf_generate_grpc_cpp_with_import_path_correction( src/proto/grpc/testing/xds/v3/http_connection_manager.proto src/proto/grpc/testing/xds/v3/http_connection_manager.proto ) @@ -2082,7 +2079,6 @@ add_library(grpc src/core/ext/xds/xds_cluster_specifier_plugin.cc src/core/ext/xds/xds_common_types.cc src/core/ext/xds/xds_endpoint.cc - src/core/ext/xds/xds_health_status.cc src/core/ext/xds/xds_http_fault_filter.cc src/core/ext/xds/xds_http_filters.cc src/core/ext/xds/xds_http_rbac_filter.cc @@ -22263,10 +22259,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -22406,10 +22398,6 @@ add_executable(xds_cluster_resource_type_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.pb.h @@ -22536,10 +22524,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -22784,10 +22768,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -23062,10 +23042,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -23242,10 +23218,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -23373,10 +23345,6 @@ add_executable(xds_endpoint_resource_type_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.h @@ -23479,10 +23447,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -23896,10 +23860,6 @@ add_executable(xds_lb_policy_registry_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/outlier_detection.pb.h @@ -24169,10 +24129,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -24414,10 +24370,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -24590,10 +24542,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h @@ -24882,10 +24830,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault_common.grpc.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h diff --git a/Makefile b/Makefile index ab772200ee0..1e42f9f2906 100644 --- a/Makefile +++ b/Makefile @@ -1362,7 +1362,6 @@ LIBGRPC_SRC = \ src/core/ext/xds/xds_cluster_specifier_plugin.cc \ src/core/ext/xds/xds_common_types.cc \ src/core/ext/xds/xds_endpoint.cc \ - src/core/ext/xds/xds_health_status.cc \ src/core/ext/xds/xds_http_fault_filter.cc \ src/core/ext/xds/xds_http_filters.cc \ src/core/ext/xds/xds_http_rbac_filter.cc \ @@ -3204,7 +3203,6 @@ src/core/ext/xds/xds_cluster.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_cluster_specifier_plugin.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_common_types.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_endpoint.cc: $(OPENSSL_DEP) -src/core/ext/xds/xds_health_status.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_http_fault_filter.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_http_filters.cc: $(OPENSSL_DEP) src/core/ext/xds/xds_http_rbac_filter.cc: $(OPENSSL_DEP) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 5b67cfa92db..f247570fe24 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -705,7 +705,6 @@ libs: - src/core/ext/xds/xds_cluster_specifier_plugin.h - src/core/ext/xds/xds_common_types.h - src/core/ext/xds/xds_endpoint.h - - src/core/ext/xds/xds_health_status.h - src/core/ext/xds/xds_http_fault_filter.h - src/core/ext/xds/xds_http_filters.h - src/core/ext/xds/xds_http_rbac_filter.h @@ -1460,7 +1459,6 @@ libs: - src/core/ext/xds/xds_cluster_specifier_plugin.cc - src/core/ext/xds/xds_common_types.cc - src/core/ext/xds/xds_endpoint.cc - - src/core/ext/xds/xds_health_status.cc - src/core/ext/xds/xds_http_fault_filter.cc - src/core/ext/xds/xds_http_filters.cc - src/core/ext/xds/xds_http_rbac_filter.cc @@ -12514,7 +12512,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -12558,7 +12555,6 @@ targets: - src/proto/grpc/testing/xds/v3/config_source.proto - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/outlier_detection.proto - src/proto/grpc/testing/xds/v3/percent.proto - src/proto/grpc/testing/xds/v3/regex.proto @@ -12598,7 +12594,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -12686,7 +12681,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -12791,7 +12785,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -12849,7 +12842,6 @@ targets: - src/proto/grpc/testing/xds/v3/extension.proto - src/proto/grpc/testing/xds/v3/fault.proto - src/proto/grpc/testing/xds/v3/fault_common.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -12884,13 +12876,11 @@ targets: gtest: true build: test language: c++ - headers: - - test/core/util/scoped_env_var.h + headers: [] src: - src/proto/grpc/testing/xds/v3/address.proto - src/proto/grpc/testing/xds/v3/base.proto - src/proto/grpc/testing/xds/v3/endpoint.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/percent.proto - test/core/xds/xds_endpoint_resource_type_test.cc deps: @@ -12923,7 +12913,6 @@ targets: - src/proto/grpc/testing/xds/v3/extension.proto - src/proto/grpc/testing/xds/v3/fault.proto - src/proto/grpc/testing/xds/v3/fault_common.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -13064,7 +13053,6 @@ targets: - src/proto/grpc/testing/xds/v3/config_source.proto - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/outlier_detection.proto - src/proto/grpc/testing/xds/v3/percent.proto - src/proto/grpc/testing/xds/v3/ring_hash.proto @@ -13156,7 +13144,6 @@ targets: - src/proto/grpc/testing/xds/v3/extension.proto - src/proto/grpc/testing/xds/v3/fault.proto - src/proto/grpc/testing/xds/v3/fault_common.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -13231,7 +13218,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -13289,7 +13275,6 @@ targets: - src/proto/grpc/testing/xds/v3/endpoint.proto - src/proto/grpc/testing/xds/v3/expr.proto - src/proto/grpc/testing/xds/v3/extension.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto @@ -13388,7 +13373,6 @@ targets: - src/proto/grpc/testing/xds/v3/extension.proto - src/proto/grpc/testing/xds/v3/fault.proto - src/proto/grpc/testing/xds/v3/fault_common.proto - - src/proto/grpc/testing/xds/v3/health_check.proto - src/proto/grpc/testing/xds/v3/http_connection_manager.proto - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto - src/proto/grpc/testing/xds/v3/listener.proto diff --git a/config.m4 b/config.m4 index db476c3bb39..d08006262f6 100644 --- a/config.m4 +++ b/config.m4 @@ -445,7 +445,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/xds/xds_cluster_specifier_plugin.cc \ src/core/ext/xds/xds_common_types.cc \ src/core/ext/xds/xds_endpoint.cc \ - src/core/ext/xds/xds_health_status.cc \ src/core/ext/xds/xds_http_fault_filter.cc \ src/core/ext/xds/xds_http_filters.cc \ src/core/ext/xds/xds_http_rbac_filter.cc \ diff --git a/config.w32 b/config.w32 index 3edbcb8466d..a18ab80c5c1 100644 --- a/config.w32 +++ b/config.w32 @@ -411,7 +411,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\xds\\xds_cluster_specifier_plugin.cc " + "src\\core\\ext\\xds\\xds_common_types.cc " + "src\\core\\ext\\xds\\xds_endpoint.cc " + - "src\\core\\ext\\xds\\xds_health_status.cc " + "src\\core\\ext\\xds\\xds_http_fault_filter.cc " + "src\\core\\ext\\xds\\xds_http_filters.cc " + "src\\core\\ext\\xds\\xds_http_rbac_filter.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 90811ceefcc..dde1e1c995f 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -664,7 +664,6 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_cluster_specifier_plugin.h', 'src/core/ext/xds/xds_common_types.h', 'src/core/ext/xds/xds_endpoint.h', - 'src/core/ext/xds/xds_health_status.h', 'src/core/ext/xds/xds_http_fault_filter.h', 'src/core/ext/xds/xds_http_filters.h', 'src/core/ext/xds/xds_http_rbac_filter.h', @@ -1562,7 +1561,6 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_cluster_specifier_plugin.h', 'src/core/ext/xds/xds_common_types.h', 'src/core/ext/xds/xds_endpoint.h', - 'src/core/ext/xds/xds_health_status.h', 'src/core/ext/xds/xds_http_fault_filter.h', 'src/core/ext/xds/xds_http_filters.h', 'src/core/ext/xds/xds_http_rbac_filter.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 54e3d01a4aa..f9953080c4c 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -993,8 +993,6 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_common_types.h', 'src/core/ext/xds/xds_endpoint.cc', 'src/core/ext/xds/xds_endpoint.h', - 'src/core/ext/xds/xds_health_status.cc', - 'src/core/ext/xds/xds_health_status.h', 'src/core/ext/xds/xds_http_fault_filter.cc', 'src/core/ext/xds/xds_http_fault_filter.h', 'src/core/ext/xds/xds_http_filters.cc', @@ -2203,7 +2201,6 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_cluster_specifier_plugin.h', 'src/core/ext/xds/xds_common_types.h', 'src/core/ext/xds/xds_endpoint.h', - 'src/core/ext/xds/xds_health_status.h', 'src/core/ext/xds/xds_http_fault_filter.h', 'src/core/ext/xds/xds_http_filters.h', 'src/core/ext/xds/xds_http_rbac_filter.h', diff --git a/grpc.gemspec b/grpc.gemspec index 72a23ce55b9..e7d14bfb13b 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -904,8 +904,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/xds/xds_common_types.h ) s.files += %w( src/core/ext/xds/xds_endpoint.cc ) s.files += %w( src/core/ext/xds/xds_endpoint.h ) - s.files += %w( src/core/ext/xds/xds_health_status.cc ) - s.files += %w( src/core/ext/xds/xds_health_status.h ) s.files += %w( src/core/ext/xds/xds_http_fault_filter.cc ) s.files += %w( src/core/ext/xds/xds_http_fault_filter.h ) s.files += %w( src/core/ext/xds/xds_http_filters.cc ) diff --git a/grpc.gyp b/grpc.gyp index 77237bac745..98e9c959390 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -775,7 +775,6 @@ 'src/core/ext/xds/xds_cluster_specifier_plugin.cc', 'src/core/ext/xds/xds_common_types.cc', 'src/core/ext/xds/xds_endpoint.cc', - 'src/core/ext/xds/xds_health_status.cc', 'src/core/ext/xds/xds_http_fault_filter.cc', 'src/core/ext/xds/xds_http_filters.cc', 'src/core/ext/xds/xds_http_rbac_filter.cc', diff --git a/package.xml b/package.xml index 92b4ed1d3f7..126b014c63f 100644 --- a/package.xml +++ b/package.xml @@ -886,8 +886,6 @@ - - diff --git a/src/core/BUILD b/src/core/BUILD index ddd38f6c4f8..aea67d36617 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -3578,7 +3578,6 @@ grpc_cc_library( "ext/xds/xds_cluster_specifier_plugin.cc", "ext/xds/xds_common_types.cc", "ext/xds/xds_endpoint.cc", - "ext/xds/xds_health_status.cc", "ext/xds/xds_http_fault_filter.cc", "ext/xds/xds_http_filters.cc", "ext/xds/xds_http_rbac_filter.cc", @@ -3600,7 +3599,6 @@ grpc_cc_library( "ext/xds/xds_cluster_specifier_plugin.h", "ext/xds/xds_common_types.h", "ext/xds/xds_endpoint.h", - "ext/xds/xds_health_status.h", "ext/xds/xds_http_fault_filter.h", "ext/xds/xds_http_filters.h", "ext/xds/xds_http_rbac_filter.h", diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc index 239f92135e6..8d31b995422 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc @@ -358,7 +358,7 @@ absl::Status CdsLb::UpdateLocked(UpdateArgs args) { // Generates the discovery mechanism config for the specified cluster name. // -// If no CDS update has been received for the cluster, starts the watcher +// If no CdsUpdate has been received for the cluster, starts the watcher // if needed, and returns false. Otherwise, generates the discovery // mechanism config, adds it to *discovery_mechanisms, and returns true. // @@ -462,13 +462,6 @@ absl::StatusOr CdsLb::GenerateDiscoveryMechanismForCluster( mechanism["lrsLoadReportingServer"] = state.update->lrs_load_reporting_server->ToJson(); } - if (!state.update->host_override_statuses.empty()) { - Json::Array status_list; - for (const auto& status : state.update->host_override_statuses) { - status_list.emplace_back(status.ToString()); - } - mechanism["overrideHostStatus"] = std::move(status_list); - } discovery_mechanisms->emplace_back(std::move(mechanism)); return true; } diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc index ae1c4cfd22a..6035b796cef 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc @@ -97,8 +97,6 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config { std::string eds_service_name; std::string dns_hostname; - Json::Array host_override_statuses; - // This is type Json::Object instead of OutlierDetectionConfig, because we // don't actually need to validate the contents of the outlier detection // config here. In this case, the JSON is generated by the CDS policy @@ -114,7 +112,6 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config { type == other.type && eds_service_name == other.eds_service_name && dns_hostname == other.dns_hostname && - host_override_statuses == other.host_override_statuses && outlier_detection_lb_config == other.outlier_detection_lb_config); } @@ -872,7 +869,6 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() { for (size_t priority = 0; priority < discovery_entry.latest_update->priorities.size(); ++priority) { - // Determine what xDS LB policy to use. Json child_policy; if (!discovery_entry.discovery_mechanism->override_child_policy() .empty()) { @@ -881,14 +877,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() { } else { child_policy = config_->xds_lb_policy(); } - // Wrap the xDS LB policy in the xds_override_host policy. - Json::Array xds_override_host_config = {Json::Object{ - {"xds_override_host_experimental", - Json::Object{ - {"overrideHostStatus", discovery_config.host_override_statuses}, - {"childPolicy", std::move(child_policy)}, - }}}}; - // Wrap it in the xds_cluster_impl policy. + // Wrap it in the drop policy. Json::Array drop_categories; if (discovery_entry.latest_update->drop_config != nullptr) { for (const auto& category : @@ -901,7 +890,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() { } Json::Object xds_cluster_impl_config = { {"clusterName", discovery_config.cluster_name}, - {"childPolicy", std::move(xds_override_host_config)}, + {"childPolicy", std::move(child_policy)}, {"dropCategories", std::move(drop_categories)}, {"maxConcurrentRequests", discovery_config.max_concurrent_requests}, }; @@ -913,7 +902,6 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() { xds_cluster_impl_config["lrsLoadReportingServer"] = discovery_config.lrs_load_reporting_server->ToJson(); } - // Wrap it in the outlier_detection policy. Json::Object outlier_detection_config; if (discovery_entry.config().outlier_detection_lb_config.has_value()) { outlier_detection_config = @@ -1044,8 +1032,6 @@ XdsClusterResolverLbConfig::DiscoveryMechanism::JsonLoader(const JsonArgs&) { &DiscoveryMechanism::max_concurrent_requests) .OptionalField("outlierDetection", &DiscoveryMechanism::outlier_detection_lb_config) - .OptionalField("overrideHostStatus", - &DiscoveryMechanism::host_override_statuses) .Finish(); return loader; } diff --git a/src/core/ext/xds/xds_cluster.cc b/src/core/ext/xds/xds_cluster.cc index 309be09b183..52f809d3524 100644 --- a/src/core/ext/xds/xds_cluster.cc +++ b/src/core/ext/xds/xds_cluster.cc @@ -35,7 +35,6 @@ #include "envoy/config/core/v3/address.upb.h" #include "envoy/config/core/v3/base.upb.h" #include "envoy/config/core/v3/config_source.upb.h" -#include "envoy/config/core/v3/health_check.upb.h" #include "envoy/config/endpoint/v3/endpoint.upb.h" #include "envoy/config/endpoint/v3/endpoint_components.upb.h" #include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h" @@ -122,15 +121,6 @@ std::string XdsClusterResource::ToString() const { } contents.push_back( absl::StrCat("max_concurrent_requests=", max_concurrent_requests)); - if (!host_override_statuses.empty()) { - std::vector statuses; - statuses.reserve(host_override_statuses.size()); - for (const auto& status : host_override_statuses) { - statuses.push_back(status.ToString()); - } - contents.push_back(absl::StrCat("override_host_statuses={", - absl::StrJoin(statuses, ", "), "}")); - } return absl::StrCat("{", absl::StrJoin(contents, ", "), "}"); } @@ -627,29 +617,6 @@ absl::StatusOr CdsResourceParse( } cds_update.outlier_detection = outlier_detection_update; } - // Validate override host status. - if (XdsHostOverrideEnabled()) { - const auto* common_lb_config = - envoy_config_cluster_v3_Cluster_common_lb_config(cluster); - if (common_lb_config != nullptr) { - ValidationErrors::ScopedField field(&errors, ".common_lb_config"); - const auto* override_host_status = - envoy_config_cluster_v3_Cluster_CommonLbConfig_override_host_status( - common_lb_config); - if (override_host_status != nullptr) { - ValidationErrors::ScopedField field(&errors, ".override_host_status"); - size_t size; - const int32_t* statuses = envoy_config_core_v3_HealthStatusSet_statuses( - override_host_status, &size); - for (size_t i = 0; i < size; ++i) { - auto status = XdsHealthStatus::FromUpb(statuses[i]); - if (status.has_value()) { - cds_update.host_override_statuses.insert(*status); - } - } - } - } - } // Return result. if (!errors.ok()) return errors.status("errors validating Cluster resource"); return cds_update; diff --git a/src/core/ext/xds/xds_cluster.h b/src/core/ext/xds/xds_cluster.h index d070abb68c7..a8812c1a28d 100644 --- a/src/core/ext/xds/xds_cluster.h +++ b/src/core/ext/xds/xds_cluster.h @@ -38,7 +38,6 @@ #include "src/core/ext/xds/xds_bootstrap_grpc.h" #include "src/core/ext/xds/xds_client.h" #include "src/core/ext/xds/xds_common_types.h" -#include "src/core/ext/xds/xds_health_status.h" #include "src/core/ext/xds/xds_resource_type.h" #include "src/core/ext/xds/xds_resource_type_impl.h" #include "src/core/lib/json/json.h" @@ -96,15 +95,12 @@ struct XdsClusterResource : public XdsResourceType::ResourceData { absl::optional outlier_detection; - std::set host_override_statuses; - bool operator==(const XdsClusterResource& other) const { return type == other.type && lb_policy_config == other.lb_policy_config && lrs_load_reporting_server == other.lrs_load_reporting_server && common_tls_context == other.common_tls_context && max_concurrent_requests == other.max_concurrent_requests && - outlier_detection == other.outlier_detection && - host_override_statuses == other.host_override_statuses; + outlier_detection == other.outlier_detection; } std::string ToString() const; diff --git a/src/core/ext/xds/xds_endpoint.cc b/src/core/ext/xds/xds_endpoint.cc index e548a941525..180491a0637 100644 --- a/src/core/ext/xds/xds_endpoint.cc +++ b/src/core/ext/xds/xds_endpoint.cc @@ -44,8 +44,6 @@ #include #include "src/core/ext/xds/upb_utils.h" -#include "src/core/ext/xds/xds_cluster.h" -#include "src/core/ext/xds/xds_health_status.h" #include "src/core/ext/xds/xds_resource_type.h" #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/address_utils/sockaddr_utils.h" @@ -152,15 +150,13 @@ absl::optional ServerAddressParse( const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint, ValidationErrors* errors) { // health_status + // If not HEALTHY or UNKNOWN, skip this endpoint. const int32_t health_status = envoy_config_endpoint_v3_LbEndpoint_health_status(lb_endpoint); - if (!XdsHostOverrideEnabled() && - health_status != envoy_config_core_v3_UNKNOWN && + if (health_status != envoy_config_core_v3_UNKNOWN && health_status != envoy_config_core_v3_HEALTHY) { return absl::nullopt; } - auto status = XdsHealthStatus::FromUpb(health_status); - if (!status.has_value()) return absl::nullopt; // load_balancing_weight uint32_t weight = 1; { @@ -221,8 +217,6 @@ absl::optional ServerAddressParse( attributes; attributes[ServerAddressWeightAttribute::kServerAddressWeightAttributeKey] = std::make_unique(weight); - attributes[XdsEndpointHealthStatusAttribute::kKey] = - std::make_unique(*status); return ServerAddress(grpc_address, ChannelArgs(), std::move(attributes)); } diff --git a/src/core/ext/xds/xds_health_status.cc b/src/core/ext/xds/xds_health_status.cc deleted file mode 100644 index 4b0addf93c3..00000000000 --- a/src/core/ext/xds/xds_health_status.cc +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#include - -#include "src/core/ext/xds/xds_health_status.h" - -#include "envoy/config/core/v3/health_check.upb.h" - -namespace grpc_core { - -absl::optional XdsHealthStatus::FromUpb(uint32_t status) { - switch (status) { - case envoy_config_core_v3_UNKNOWN: - return XdsHealthStatus(kUnknown); - case envoy_config_core_v3_HEALTHY: - return XdsHealthStatus(kHealthy); - case envoy_config_core_v3_DRAINING: - return XdsHealthStatus(kDraining); - default: - return absl::nullopt; - } -} - -absl::optional XdsHealthStatus::FromString( - absl::string_view status) { - if (status == "UNKNOWN") return XdsHealthStatus(kUnknown); - if (status == "HEALTHY") return XdsHealthStatus(kHealthy); - if (status == "DRAINING") return XdsHealthStatus(kDraining); - return absl::nullopt; -} - -const char* XdsHealthStatus::ToString() const { - switch (status_) { - case kUnknown: - return "UNKNOWN"; - case kHealthy: - return "HEALTHY"; - case kDraining: - return "DRAINING"; - } -} - -bool operator<(const XdsHealthStatus& hs1, const XdsHealthStatus& hs2) { - return hs1.status() < hs2.status(); -} - -const char* XdsEndpointHealthStatusAttribute::kKey = - "xds_endpoint_health_status"; - -int XdsEndpointHealthStatusAttribute::Cmp( - const AttributeInterface* other) const { - const auto* other_attr = - static_cast(other); - return QsortCompare(status_, other_attr->status_); -} - -std::string XdsEndpointHealthStatusAttribute::ToString() const { - return absl::StrCat("{status_=", status_.ToString(), "}"); -} - -} // namespace grpc_core diff --git a/src/core/ext/xds/xds_health_status.h b/src/core/ext/xds/xds_health_status.h deleted file mode 100644 index d92d69accfb..00000000000 --- a/src/core/ext/xds/xds_health_status.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#ifndef GRPC_CORE_EXT_XDS_XDS_HEALTH_STATUS_H -#define GRPC_CORE_EXT_XDS_XDS_HEALTH_STATUS_H - -#include - -#include - -#include "absl/types/optional.h" - -#include "src/core/lib/resolver/server_address.h" - -namespace grpc_core { - -class XdsHealthStatus { - public: - enum HealthStatus { kUnknown, kHealthy, kDraining }; - - // Returns an XdsHealthStatus for supported enum values, else nullopt. - static absl::optional FromUpb(uint32_t status); - static absl::optional FromString(absl::string_view status); - - explicit XdsHealthStatus(HealthStatus status) : status_(status) {} - - HealthStatus status() const { return status_; } - - bool operator==(const XdsHealthStatus& other) const { - return status_ == other.status_; - } - - const char* ToString() const; - - private: - HealthStatus status_; -}; - -bool operator<(const XdsHealthStatus& hs1, const XdsHealthStatus& hs2); - -class XdsEndpointHealthStatusAttribute - : public ServerAddress::AttributeInterface { - public: - static const char* kKey; - - explicit XdsEndpointHealthStatusAttribute(XdsHealthStatus status) - : status_(status) {} - - XdsHealthStatus status() const { return status_; } - - std::unique_ptr Copy() const override { - return std::make_unique(status_); - } - - int Cmp(const AttributeInterface* other) const override; - - std::string ToString() const override; - - private: - XdsHealthStatus status_; -}; - -} // namespace grpc_core - -#endif // GRPC_CORE_EXT_XDS_XDS_HEALTH_STATUS_H diff --git a/src/core/lib/json/json_object_loader.cc b/src/core/lib/json/json_object_loader.cc index b9d49b76a78..6a5168e45d8 100644 --- a/src/core/lib/json/json_object_loader.cc +++ b/src/core/lib/json/json_object_loader.cc @@ -110,16 +110,6 @@ void LoadUnprocessedJsonObject::LoadInto(const Json& json, const JsonArgs&, *static_cast(dst) = json.object_value(); } -void LoadUnprocessedJsonArray::LoadInto(const Json& json, const JsonArgs&, - void* dst, - ValidationErrors* errors) const { - if (json.type() != Json::Type::ARRAY) { - errors->AddError("is not an array"); - return; - } - *static_cast(dst) = json.array_value(); -} - void LoadVector::LoadInto(const Json& json, const JsonArgs& args, void* dst, ValidationErrors* errors) const { if (json.type() != Json::Type::ARRAY) { diff --git a/src/core/lib/json/json_object_loader.h b/src/core/lib/json/json_object_loader.h index 29f534c7e08..9ee279cd457 100644 --- a/src/core/lib/json/json_object_loader.h +++ b/src/core/lib/json/json_object_loader.h @@ -214,16 +214,6 @@ class LoadUnprocessedJsonObject : public LoaderInterface { ~LoadUnprocessedJsonObject() = default; }; -// Loads an unprocessed JSON array value. -class LoadUnprocessedJsonArray : public LoaderInterface { - public: - void LoadInto(const Json& json, const JsonArgs& /*args*/, void* dst, - ValidationErrors* errors) const override; - - protected: - ~LoadUnprocessedJsonArray() = default; -}; - // Load a vector of some type. class LoadVector : public LoaderInterface { public: @@ -338,11 +328,6 @@ class AutoLoader final : public LoadUnprocessedJsonObject { private: ~AutoLoader() = default; }; -template <> -class AutoLoader final : public LoadUnprocessedJsonArray { - private: - ~AutoLoader() = default; -}; // Specializations of AutoLoader for vectors. template diff --git a/src/proto/grpc/testing/xds/v3/BUILD b/src/proto/grpc/testing/xds/v3/BUILD index b82a47cccbf..890eb54eff6 100644 --- a/src/proto/grpc/testing/xds/v3/BUILD +++ b/src/proto/grpc/testing/xds/v3/BUILD @@ -93,7 +93,6 @@ grpc_proto_library( "config_source_proto", "endpoint_proto", "extension_proto", - "health_check_proto", "outlier_detection_proto", ], ) @@ -107,18 +106,10 @@ grpc_proto_library( deps = [ "address_proto", "base_proto", - "health_check_proto", "percent_proto", ], ) -grpc_proto_library( - name = "health_check_proto", - srcs = [ - "health_check.proto", - ], -) - grpc_proto_library( name = "extension_proto", srcs = [ diff --git a/src/proto/grpc/testing/xds/v3/cluster.proto b/src/proto/grpc/testing/xds/v3/cluster.proto index 531fbd7e0b8..dcdcc82a50d 100644 --- a/src/proto/grpc/testing/xds/v3/cluster.proto +++ b/src/proto/grpc/testing/xds/v3/cluster.proto @@ -22,7 +22,6 @@ import "src/proto/grpc/testing/xds/v3/base.proto"; import "src/proto/grpc/testing/xds/v3/config_source.proto"; import "src/proto/grpc/testing/xds/v3/endpoint.proto"; import "src/proto/grpc/testing/xds/v3/extension.proto"; -import "src/proto/grpc/testing/xds/v3/health_check.proto"; import "src/proto/grpc/testing/xds/v3/outlier_detection.proto"; import "google/protobuf/any.proto"; @@ -138,10 +137,6 @@ message Cluster { string service_name = 2; } - message CommonLbConfig { - core.v3.HealthStatusSet override_host_status = 8; - } - // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting // :ref:`statistics ` if :ref:`alt_stat_name @@ -223,8 +218,6 @@ message Cluster { RingHashLbConfig ring_hash_lb_config = 23; } - CommonLbConfig common_lb_config = 27; - // Optional custom transport socket implementation to use for upstream connections. // To setup TLS, set a transport socket with name `tls` and // :ref:`UpstreamTlsContexts ` in the `typed_config`. diff --git a/src/proto/grpc/testing/xds/v3/endpoint.proto b/src/proto/grpc/testing/xds/v3/endpoint.proto index 7886fb3c6af..7cbea7f443f 100644 --- a/src/proto/grpc/testing/xds/v3/endpoint.proto +++ b/src/proto/grpc/testing/xds/v3/endpoint.proto @@ -20,13 +20,38 @@ package envoy.config.endpoint.v3; import "src/proto/grpc/testing/xds/v3/address.proto"; import "src/proto/grpc/testing/xds/v3/base.proto"; -import "src/proto/grpc/testing/xds/v3/health_check.proto"; import "src/proto/grpc/testing/xds/v3/percent.proto"; import "google/protobuf/wrappers.proto"; // [#protodoc-title: Endpoints] +// Endpoint health status. +enum HealthStatus { + // The health status is not known. This is interpreted by Envoy as *HEALTHY*. + UNKNOWN = 0; + + // Healthy. + HEALTHY = 1; + + // Unhealthy. + UNHEALTHY = 2; + + // Connection draining in progress. E.g., + // ``_ + // or + // ``_. + // This is interpreted by Envoy as *UNHEALTHY*. + DRAINING = 3; + + // Health check timed out. This is part of HDS and is interpreted by Envoy as + // *UNHEALTHY*. + TIMEOUT = 4; + + // Degraded. + DEGRADED = 5; +} + // Upstream host identifier. message Endpoint { // The upstream host address. @@ -50,7 +75,7 @@ message LbEndpoint { } // Optional health status when known and supplied by EDS server. - core.v3.HealthStatus health_status = 2; + HealthStatus health_status = 2; // The optional load balancing weight of the upstream host; at least 1. // Envoy uses the load balancing weight in some of the built in load diff --git a/src/proto/grpc/testing/xds/v3/health_check.proto b/src/proto/grpc/testing/xds/v3/health_check.proto deleted file mode 100644 index 14a8f1e31a0..00000000000 --- a/src/proto/grpc/testing/xds/v3/health_check.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Local copy of Envoy xDS proto file, used for testing only. - -syntax = "proto3"; - -package envoy.config.core.v3; - -// [#protodoc-title: Health check] -// * Health checking :ref:`architecture overview `. -// * If health checking is configured for a cluster, additional statistics are emitted. They are -// documented :ref:`here `. - -// Endpoint health status. -enum HealthStatus { - // The health status is not known. This is interpreted by Envoy as ``HEALTHY``. - UNKNOWN = 0; - - // Healthy. - HEALTHY = 1; - - // Unhealthy. - UNHEALTHY = 2; - - // Connection draining in progress. E.g., - // ``_ - // or - // ``_. - // This is interpreted by Envoy as ``UNHEALTHY``. - DRAINING = 3; - - // Health check timed out. This is part of HDS and is interpreted by Envoy as - // ``UNHEALTHY``. - TIMEOUT = 4; - - // Degraded. - DEGRADED = 5; -} - -message HealthStatusSet { - // An order-independent set of health status. - repeated HealthStatus statuses = 1; -} diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 29291b9d1d0..c73edf19488 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -420,7 +420,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/xds/xds_cluster_specifier_plugin.cc', 'src/core/ext/xds/xds_common_types.cc', 'src/core/ext/xds/xds_endpoint.cc', - 'src/core/ext/xds/xds_health_status.cc', 'src/core/ext/xds/xds_http_fault_filter.cc', 'src/core/ext/xds/xds_http_filters.cc', 'src/core/ext/xds/xds_http_rbac_filter.cc', diff --git a/test/core/json/json_object_loader_test.cc b/test/core/json/json_object_loader_test.cc index 848e6f3cff0..1c41e1cb7c6 100644 --- a/test/core/json/json_object_loader_test.cc +++ b/test/core/json/json_object_loader_test.cc @@ -569,67 +569,6 @@ TEST(JsonObjectLoader, JsonObjectFields) { << test_struct.status(); } -// -// Json::Array tests -// - -TEST(JsonObjectLoader, JsonArrayFields) { - struct TestStruct { - Json::Array value; - Json::Array optional_value; - absl::optional absl_optional_value; - std::unique_ptr unique_ptr_value; - - static const JsonLoaderInterface* JsonLoader(const JsonArgs&) { - static const auto* loader = - JsonObjectLoader() - .Field("value", &TestStruct::value) - .OptionalField("optional_value", &TestStruct::optional_value) - .OptionalField("absl_optional_value", - &TestStruct::absl_optional_value) - .OptionalField("unique_ptr_value", &TestStruct::unique_ptr_value) - .Finish(); - return loader; - } - }; - // Valid object. - auto test_struct = Parse("{\"value\": [1, \"a\"]}"); - ASSERT_TRUE(test_struct.ok()) << test_struct.status(); - EXPECT_EQ(Json{test_struct->value}.Dump(), "[1,\"a\"]"); - EXPECT_EQ(Json{test_struct->optional_value}.Dump(), "[]"); - EXPECT_FALSE(test_struct->absl_optional_value.has_value()); - EXPECT_EQ(test_struct->unique_ptr_value, nullptr); - // Fails if required field is not present. - test_struct = Parse("{}"); - EXPECT_EQ(test_struct.status().code(), absl::StatusCode::kInvalidArgument); - EXPECT_EQ(test_struct.status().message(), - "errors validating JSON: [field:value error:field not present]") - << test_struct.status(); - // Optional fields present. - test_struct = Parse( - "{\"value\": [1, \"a\"], \"optional_value\": [2, \"b\"], " - "\"absl_optional_value\": [3, \"c\"], \"unique_ptr_value\": [4, \"d\"]}"); - ASSERT_TRUE(test_struct.ok()) << test_struct.status(); - EXPECT_EQ(Json{test_struct->value}.Dump(), "[1,\"a\"]"); - EXPECT_EQ(Json{test_struct->optional_value}.Dump(), "[2,\"b\"]"); - ASSERT_TRUE(test_struct->absl_optional_value.has_value()); - EXPECT_EQ(Json{*test_struct->absl_optional_value}.Dump(), "[3,\"c\"]"); - ASSERT_NE(test_struct->unique_ptr_value, nullptr); - EXPECT_EQ(Json{*test_struct->unique_ptr_value}.Dump(), "[4,\"d\"]"); - // Wrong JSON type. - test_struct = Parse( - "{\"value\": {}, \"optional_value\": true, " - "\"absl_optional_value\": 1, \"unique_ptr_value\": \"foo\"}"); - EXPECT_EQ(test_struct.status().code(), absl::StatusCode::kInvalidArgument); - EXPECT_EQ(test_struct.status().message(), - "errors validating JSON: [" - "field:absl_optional_value error:is not an array; " - "field:optional_value error:is not an array; " - "field:unique_ptr_value error:is not an array; " - "field:value error:is not an array]") - << test_struct.status(); -} - // // map<> tests // diff --git a/test/core/xds/BUILD b/test/core/xds/BUILD index 573d48dd834..8bdc344a9e3 100644 --- a/test/core/xds/BUILD +++ b/test/core/xds/BUILD @@ -308,6 +308,5 @@ grpc_cc_test( "//src/core:grpc_xds_client", "//src/proto/grpc/testing/xds/v3:endpoint_proto", "//test/core/util:grpc_test_util", - "//test/core/util:scoped_env_var", ], ) diff --git a/test/core/xds/xds_cluster_resource_type_test.cc b/test/core/xds/xds_cluster_resource_type_test.cc index 8c7c170b13a..28705da651f 100644 --- a/test/core/xds/xds_cluster_resource_type_test.cc +++ b/test/core/xds/xds_cluster_resource_type_test.cc @@ -1287,64 +1287,6 @@ TEST_F(OutlierDetectionTest, InvalidValues) { << decode_result.resource.status(); } -// -// host override status tests -// - -using HostOverrideStatusTest = XdsClusterTest; - -TEST_F(HostOverrideStatusTest, IgnoredWhenNotEnabled) { - Cluster cluster; - cluster.set_name("foo"); - cluster.set_type(cluster.EDS); - cluster.mutable_eds_cluster_config()->mutable_eds_config()->mutable_self(); - auto* status_set = - cluster.mutable_common_lb_config()->mutable_override_host_status(); - status_set->add_statuses(envoy::config::core::v3::UNKNOWN); - status_set->add_statuses(envoy::config::core::v3::HEALTHY); - status_set->add_statuses(envoy::config::core::v3::DRAINING); - status_set->add_statuses(envoy::config::core::v3::UNHEALTHY); - std::string serialized_resource; - ASSERT_TRUE(cluster.SerializeToString(&serialized_resource)); - auto* resource_type = XdsClusterResourceType::Get(); - auto decode_result = - resource_type->Decode(decode_context_, serialized_resource); - ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status(); - ASSERT_TRUE(decode_result.name.has_value()); - EXPECT_EQ(*decode_result.name, "foo"); - auto& resource = static_cast(**decode_result.resource); - EXPECT_THAT(resource.host_override_statuses, ::testing::ElementsAre()); -} - -TEST_F(HostOverrideStatusTest, PassesOnRelevantHealthStatuses) { - ScopedExperimentalEnvVar env_var( - "GRPC_EXPERIMENTAL_XDS_ENABLE_HOST_OVERRIDE"); - Cluster cluster; - cluster.set_name("foo"); - cluster.set_type(cluster.EDS); - cluster.mutable_eds_cluster_config()->mutable_eds_config()->mutable_self(); - auto* status_set = - cluster.mutable_common_lb_config()->mutable_override_host_status(); - status_set->add_statuses(envoy::config::core::v3::UNKNOWN); - status_set->add_statuses(envoy::config::core::v3::HEALTHY); - status_set->add_statuses(envoy::config::core::v3::DRAINING); - status_set->add_statuses(envoy::config::core::v3::UNHEALTHY); - std::string serialized_resource; - ASSERT_TRUE(cluster.SerializeToString(&serialized_resource)); - auto* resource_type = XdsClusterResourceType::Get(); - auto decode_result = - resource_type->Decode(decode_context_, serialized_resource); - ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status(); - ASSERT_TRUE(decode_result.name.has_value()); - EXPECT_EQ(*decode_result.name, "foo"); - auto& resource = static_cast(**decode_result.resource); - EXPECT_THAT(resource.host_override_statuses, - ::testing::UnorderedElementsAre( - XdsHealthStatus(XdsHealthStatus::kUnknown), - XdsHealthStatus(XdsHealthStatus::kHealthy), - XdsHealthStatus(XdsHealthStatus::kDraining))); -} - } // namespace } // namespace testing } // namespace grpc_core diff --git a/test/core/xds/xds_endpoint_resource_type_test.cc b/test/core/xds/xds_endpoint_resource_type_test.cc index 22b4f314645..8786178f1b9 100644 --- a/test/core/xds/xds_endpoint_resource_type_test.cc +++ b/test/core/xds/xds_endpoint_resource_type_test.cc @@ -39,7 +39,6 @@ #include "src/core/ext/xds/xds_client.h" #include "src/core/ext/xds/xds_client_stats.h" #include "src/core/ext/xds/xds_endpoint.h" -#include "src/core/ext/xds/xds_health_status.h" #include "src/core/ext/xds/xds_resource_type.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" @@ -51,7 +50,6 @@ #include "src/proto/grpc/testing/xds/v3/base.pb.h" #include "src/proto/grpc/testing/xds/v3/endpoint.pb.h" #include "src/proto/grpc/testing/xds/v3/percent.pb.h" -#include "test/core/util/scoped_env_var.h" #include "test/core/util/test_config.h" using envoy::config::endpoint::v3::ClusterLoadAssignment; @@ -913,117 +911,6 @@ TEST_F(XdsEndpointTest, DropPercentageInvalidDenominator) { << decode_result.resource.status(); } -TEST_F(XdsEndpointTest, IgnoresEndpointsInUnsupportedStates) { - ClusterLoadAssignment cla; - cla.set_cluster_name("foo"); - auto* locality = cla.add_endpoints(); - locality->mutable_load_balancing_weight()->set_value(1); - auto* locality_name = locality->mutable_locality(); - locality_name->set_region("myregion"); - locality_name->set_zone("myzone"); - locality_name->set_sub_zone("mysubzone"); - auto* endpoint = locality->add_lb_endpoints(); - auto* socket_address = - endpoint->mutable_endpoint()->mutable_address()->mutable_socket_address(); - socket_address->set_address("127.0.0.1"); - socket_address->set_port_value(443); - endpoint = locality->add_lb_endpoints(); - endpoint->set_health_status(envoy::config::core::v3::HealthStatus::DRAINING); - socket_address = - endpoint->mutable_endpoint()->mutable_address()->mutable_socket_address(); - socket_address->set_address("127.0.0.1"); - socket_address->set_port_value(444); - std::string serialized_resource; - ASSERT_TRUE(cla.SerializeToString(&serialized_resource)); - auto* resource_type = XdsEndpointResourceType::Get(); - auto decode_result = - resource_type->Decode(decode_context_, serialized_resource); - ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status(); - ASSERT_TRUE(decode_result.name.has_value()); - EXPECT_EQ(*decode_result.name, "foo"); - auto& resource = static_cast(**decode_result.resource); - ASSERT_EQ(resource.priorities.size(), 1); - const auto& priority = resource.priorities[0]; - ASSERT_EQ(priority.localities.size(), 1); - const auto& p = *priority.localities.begin(); - ASSERT_EQ(p.first, p.second.name.get()); - EXPECT_EQ(p.first->region(), "myregion"); - EXPECT_EQ(p.first->zone(), "myzone"); - EXPECT_EQ(p.first->sub_zone(), "mysubzone"); - EXPECT_EQ(p.second.lb_weight, 1); - ASSERT_EQ(p.second.endpoints.size(), 1); - const auto& address = p.second.endpoints.front(); - auto addr = grpc_sockaddr_to_string(&address.address(), /*normalize=*/false); - ASSERT_TRUE(addr.ok()) << addr.status(); - EXPECT_EQ(*addr, "127.0.0.1:443"); -} - -TEST_F(XdsEndpointTest, EndpointHealthStatus) { - ScopedExperimentalEnvVar env_var( - "GRPC_EXPERIMENTAL_XDS_ENABLE_HOST_OVERRIDE"); - ClusterLoadAssignment cla; - cla.set_cluster_name("foo"); - auto* locality = cla.add_endpoints(); - locality->mutable_load_balancing_weight()->set_value(1); - auto* locality_name = locality->mutable_locality(); - locality_name->set_region("myregion"); - locality_name->set_zone("myzone"); - locality_name->set_sub_zone("mysubzone"); - auto* endpoint = locality->add_lb_endpoints(); - auto* socket_address = - endpoint->mutable_endpoint()->mutable_address()->mutable_socket_address(); - socket_address->set_address("127.0.0.1"); - socket_address->set_port_value(443); - endpoint = locality->add_lb_endpoints(); - endpoint->set_health_status(envoy::config::core::v3::HealthStatus::DRAINING); - socket_address = - endpoint->mutable_endpoint()->mutable_address()->mutable_socket_address(); - socket_address->set_address("127.0.0.2"); - socket_address->set_port_value(443); - endpoint = locality->add_lb_endpoints(); - endpoint->set_health_status(envoy::config::core::v3::HealthStatus::UNHEALTHY); - socket_address = - endpoint->mutable_endpoint()->mutable_address()->mutable_socket_address(); - socket_address->set_address("127.0.0.3"); - socket_address->set_port_value(443); - std::string serialized_resource; - ASSERT_TRUE(cla.SerializeToString(&serialized_resource)); - auto* resource_type = XdsEndpointResourceType::Get(); - auto decode_result = - resource_type->Decode(decode_context_, serialized_resource); - ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status(); - ASSERT_TRUE(decode_result.name.has_value()); - EXPECT_EQ(*decode_result.name, "foo"); - auto& resource = static_cast(**decode_result.resource); - ASSERT_EQ(resource.priorities.size(), 1); - const auto& priority = resource.priorities[0]; - ASSERT_EQ(priority.localities.size(), 1); - const auto& p = *priority.localities.begin(); - ASSERT_EQ(p.first, p.second.name.get()); - EXPECT_EQ(p.first->region(), "myregion"); - EXPECT_EQ(p.first->zone(), "myzone"); - EXPECT_EQ(p.first->sub_zone(), "mysubzone"); - EXPECT_EQ(p.second.lb_weight, 1); - ASSERT_EQ(p.second.endpoints.size(), 2); - const auto* address = &p.second.endpoints[0]; - auto addr = grpc_sockaddr_to_string(&address->address(), /*normalize=*/false); - ASSERT_TRUE(addr.ok()) << addr.status(); - EXPECT_EQ(*addr, "127.0.0.1:443"); - const auto* health_attribute = - static_cast( - address->GetAttribute(XdsEndpointHealthStatusAttribute::kKey)); - ASSERT_NE(health_attribute, nullptr); - EXPECT_EQ(health_attribute->status().status(), XdsHealthStatus::kUnknown); - address = &p.second.endpoints[1]; - addr = grpc_sockaddr_to_string(&address->address(), /*normalize=*/false); - ASSERT_TRUE(addr.ok()) << addr.status(); - EXPECT_EQ(*addr, "127.0.0.2:443"); - health_attribute = static_cast( - address->GetAttribute(XdsEndpointHealthStatusAttribute::kKey)); - ASSERT_NE(health_attribute, nullptr); - EXPECT_EQ(health_attribute->status().status(), XdsHealthStatus::kDraining); -} - } // namespace } // namespace testing } // namespace grpc_core diff --git a/test/cpp/end2end/xds/xds_cluster_end2end_test.cc b/test/cpp/end2end/xds/xds_cluster_end2end_test.cc index 016c8b03840..1776453d95b 100644 --- a/test/cpp/end2end/xds/xds_cluster_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_cluster_end2end_test.cc @@ -34,7 +34,7 @@ namespace { using ::envoy::config::cluster::v3::CircuitBreakers; using ::envoy::config::cluster::v3::RoutingPriority; -using ::envoy::config::core::v3::HealthStatus; +using ::envoy::config::endpoint::v3::HealthStatus; using ::envoy::type::v3::FractionalPercent; using ClientStats = LrsServiceImpl::ClientStats; diff --git a/test/cpp/end2end/xds/xds_end2end_test_lib.cc b/test/cpp/end2end/xds/xds_end2end_test_lib.cc index 7c70693d54a..a5a5a70c36b 100644 --- a/test/cpp/end2end/xds/xds_end2end_test_lib.cc +++ b/test/cpp/end2end/xds/xds_end2end_test_lib.cc @@ -51,8 +51,8 @@ namespace grpc { namespace testing { -using ::envoy::config::core::v3::HealthStatus; using ::envoy::config::endpoint::v3::ClusterLoadAssignment; +using ::envoy::config::endpoint::v3::HealthStatus; using ::envoy::config::listener::v3::Listener; using ::envoy::extensions::filters::network::http_connection_manager::v3:: HttpConnectionManager; diff --git a/test/cpp/end2end/xds/xds_end2end_test_lib.h b/test/cpp/end2end/xds/xds_end2end_test_lib.h index ab0ec3858d9..401ceb87f89 100644 --- a/test/cpp/end2end/xds/xds_end2end_test_lib.h +++ b/test/cpp/end2end/xds/xds_end2end_test_lib.h @@ -542,14 +542,15 @@ class XdsEnd2endTest : public ::testing::TestWithParam { struct EdsResourceArgs { // An individual endpoint for a backend running on a specified port. struct Endpoint { - explicit Endpoint(int port, - ::envoy::config::core::v3::HealthStatus health_status = - ::envoy::config::core::v3::HealthStatus::UNKNOWN, - int lb_weight = 1) + explicit Endpoint( + int port, + ::envoy::config::endpoint::v3::HealthStatus health_status = + ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, + int lb_weight = 1) : port(port), health_status(health_status), lb_weight(lb_weight) {} int port; - ::envoy::config::core::v3::HealthStatus health_status; + ::envoy::config::endpoint::v3::HealthStatus health_status; int lb_weight; }; @@ -583,8 +584,8 @@ class XdsEnd2endTest : public ::testing::TestWithParam { // constructing an EDS resource. EdsResourceArgs::Endpoint CreateEndpoint( size_t backend_idx, - ::envoy::config::core::v3::HealthStatus health_status = - ::envoy::config::core::v3::HealthStatus::UNKNOWN, + ::envoy::config::endpoint::v3::HealthStatus health_status = + ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, int lb_weight = 1) { return EdsResourceArgs::Endpoint(backends_[backend_idx]->port(), health_status, lb_weight); @@ -594,8 +595,8 @@ class XdsEnd2endTest : public ::testing::TestWithParam { // for use in constructing an EDS resource. std::vector CreateEndpointsForBackends( size_t start_index = 0, size_t stop_index = 0, - ::envoy::config::core::v3::HealthStatus health_status = - ::envoy::config::core::v3::HealthStatus::UNKNOWN, + ::envoy::config::endpoint::v3::HealthStatus health_status = + ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, int lb_weight = 1); // Returns an endpoint for an unused port, for use in constructing an diff --git a/test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc b/test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc index 42baff5a8f8..d5c5a32d059 100644 --- a/test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc @@ -39,7 +39,7 @@ namespace testing { namespace { using ::envoy::config::cluster::v3::CustomClusterType; -using ::envoy::config::core::v3::HealthStatus; +using ::envoy::config::endpoint::v3::HealthStatus; using ::envoy::extensions::clusters::aggregate::v3::ClusterConfig; class RingHashTest : public XdsEnd2endTest { @@ -504,9 +504,11 @@ TEST_P(RingHashTest, EndpointWeights) { // Endpoint 2 has weight 2. EdsResourceArgs args( {{"locality0", - {CreateEndpoint(0, ::envoy::config::core::v3::HealthStatus::UNKNOWN, 0), - CreateEndpoint(1, ::envoy::config::core::v3::HealthStatus::UNKNOWN, 1), - CreateEndpoint(2, ::envoy::config::core::v3::HealthStatus::UNKNOWN, + {CreateEndpoint(0, ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, + 0), + CreateEndpoint(1, ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, + 1), + CreateEndpoint(2, ::envoy::config::endpoint::v3::HealthStatus::UNKNOWN, 2)}}}); balancer_->ads_service()->SetEdsResource(BuildEdsResource(args)); // TODO(donnadionne): remove extended timeout after ring creation diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 182ffb8e4df..050b619e8cc 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1902,8 +1902,6 @@ src/core/ext/xds/xds_common_types.cc \ src/core/ext/xds/xds_common_types.h \ src/core/ext/xds/xds_endpoint.cc \ src/core/ext/xds/xds_endpoint.h \ -src/core/ext/xds/xds_health_status.cc \ -src/core/ext/xds/xds_health_status.h \ src/core/ext/xds/xds_http_fault_filter.cc \ src/core/ext/xds/xds_http_fault_filter.h \ src/core/ext/xds/xds_http_filters.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 52280ed23db..a0fbcc8abdf 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1675,8 +1675,6 @@ src/core/ext/xds/xds_common_types.cc \ src/core/ext/xds/xds_common_types.h \ src/core/ext/xds/xds_endpoint.cc \ src/core/ext/xds/xds_endpoint.h \ -src/core/ext/xds/xds_health_status.cc \ -src/core/ext/xds/xds_health_status.h \ src/core/ext/xds/xds_http_fault_filter.cc \ src/core/ext/xds/xds_http_fault_filter.h \ src/core/ext/xds/xds_http_filters.cc \