Skip to content

Commit

Permalink
Merge pull request grpc#23582 from markdroth/grpclb_authority
Browse files Browse the repository at this point in the history
Remove TargetAuthorityTable in favor of a per-address channel arg.
  • Loading branch information
markdroth authored Jul 29, 2020
2 parents 12074d6 + c35a37d commit 60283a1
Show file tree
Hide file tree
Showing 38 changed files with 120 additions and 1,182 deletions.
6 changes: 2 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ grpc_cc_library(
"src/core/lib/surface/server.cc",
"src/core/lib/surface/validate_metadata.cc",
"src/core/lib/surface/version.cc",
"src/core/lib/transport/authority_override.cc",
"src/core/lib/transport/bdp_estimator.cc",
"src/core/lib/transport/byte_stream.cc",
"src/core/lib/transport/connectivity_state.cc",
Expand Down Expand Up @@ -919,11 +920,9 @@ grpc_cc_library(
"src/core/lib/json/json.h",
"src/core/lib/slice/b64.h",
"src/core/lib/slice/percent_encoding.h",
"src/core/lib/slice/slice_hash_table.h",
"src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/slice/slice_utils.h",
"src/core/lib/slice/slice_weak_hash_table.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
Expand All @@ -937,6 +936,7 @@ grpc_cc_library(
"src/core/lib/surface/lame_client.h",
"src/core/lib/surface/server.h",
"src/core/lib/surface/validate_metadata.h",
"src/core/lib/transport/authority_override.h",
"src/core/lib/transport/bdp_estimator.h",
"src/core/lib/transport/byte_stream.h",
"src/core/lib/transport/connectivity_state.h",
Expand Down Expand Up @@ -1807,7 +1807,6 @@ grpc_cc_library(
"src/core/lib/security/transport/secure_endpoint.cc",
"src/core/lib/security/transport/security_handshaker.cc",
"src/core/lib/security/transport/server_auth_filter.cc",
"src/core/lib/security/transport/target_authority_table.cc",
"src/core/lib/security/transport/tsi_error.cc",
"src/core/lib/security/util/json_util.cc",
"src/core/lib/surface/init_secure.cc",
Expand Down Expand Up @@ -1844,7 +1843,6 @@ grpc_cc_library(
"src/core/lib/security/transport/auth_filters.h",
"src/core/lib/security/transport/secure_endpoint.h",
"src/core/lib/security/transport/security_handshaker.h",
"src/core/lib/security/transport/target_authority_table.h",
"src/core/lib/security/transport/tsi_error.h",
"src/core/lib/security/util/json_util.h",
],
Expand Down
6 changes: 2 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,6 @@ config("grpc_config") {
"src/core/lib/security/transport/security_handshaker.cc",
"src/core/lib/security/transport/security_handshaker.h",
"src/core/lib/security/transport/server_auth_filter.cc",
"src/core/lib/security/transport/target_authority_table.cc",
"src/core/lib/security/transport/target_authority_table.h",
"src/core/lib/security/transport/tsi_error.cc",
"src/core/lib/security/transport/tsi_error.h",
"src/core/lib/security/util/json_util.cc",
Expand All @@ -858,13 +856,11 @@ config("grpc_config") {
"src/core/lib/slice/percent_encoding.h",
"src/core/lib/slice/slice.cc",
"src/core/lib/slice/slice_buffer.cc",
"src/core/lib/slice/slice_hash_table.h",
"src/core/lib/slice/slice_intern.cc",
"src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.cc",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/slice/slice_utils.h",
"src/core/lib/slice/slice_weak_hash_table.h",
"src/core/lib/surface/api_trace.cc",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/byte_buffer.cc",
Expand Down Expand Up @@ -898,6 +894,8 @@ config("grpc_config") {
"src/core/lib/surface/validate_metadata.cc",
"src/core/lib/surface/validate_metadata.h",
"src/core/lib/surface/version.cc",
"src/core/lib/transport/authority_override.cc",
"src/core/lib/transport/authority_override.h",
"src/core/lib/transport/bdp_estimator.cc",
"src/core/lib/transport/bdp_estimator.h",
"src/core/lib/transport/byte_stream.cc",
Expand Down
83 changes: 2 additions & 81 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx settings_timeout_test)
add_dependencies(buildtests_cxx shutdown_test)
add_dependencies(buildtests_cxx simple_request_bad_client_test)
add_dependencies(buildtests_cxx slice_hash_table_test)
add_dependencies(buildtests_cxx slice_weak_hash_table_test)
add_dependencies(buildtests_cxx static_metadata_test)
add_dependencies(buildtests_cxx stats_test)
add_dependencies(buildtests_cxx status_metadata_test)
Expand Down Expand Up @@ -1736,7 +1734,6 @@ add_library(grpc
src/core/lib/security/transport/secure_endpoint.cc
src/core/lib/security/transport/security_handshaker.cc
src/core/lib/security/transport/server_auth_filter.cc
src/core/lib/security/transport/target_authority_table.cc
src/core/lib/security/transport/tsi_error.cc
src/core/lib/security/util/json_util.cc
src/core/lib/slice/b64.cc
Expand Down Expand Up @@ -1765,6 +1762,7 @@ add_library(grpc
src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc
src/core/lib/surface/version.cc
src/core/lib/transport/authority_override.cc
src/core/lib/transport/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc
Expand Down Expand Up @@ -2395,6 +2393,7 @@ add_library(grpc_unsecure
src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc
src/core/lib/surface/version.cc
src/core/lib/transport/authority_override.cc
src/core/lib/transport/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc
Expand Down Expand Up @@ -13816,84 +13815,6 @@ target_link_libraries(simple_request_bad_client_test
)


endif()
if(gRPC_BUILD_TESTS)

add_executable(slice_hash_table_test
test/core/slice/slice_hash_table_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)

target_include_directories(slice_hash_table_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)

target_link_libraries(slice_hash_table_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
address_sorting
upb
${_gRPC_GFLAGS_LIBRARIES}
)


endif()
if(gRPC_BUILD_TESTS)

add_executable(slice_weak_hash_table_test
test/core/slice/slice_weak_hash_table_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)

target_include_directories(slice_weak_hash_table_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)

target_link_libraries(slice_weak_hash_table_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
address_sorting
upb
${_gRPC_GFLAGS_LIBRARIES}
)


endif()
if(gRPC_BUILD_TESTS)

Expand Down
100 changes: 2 additions & 98 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,6 @@ service_config_test: $(BINDIR)/$(CONFIG)/service_config_test
settings_timeout_test: $(BINDIR)/$(CONFIG)/settings_timeout_test
shutdown_test: $(BINDIR)/$(CONFIG)/shutdown_test
simple_request_bad_client_test: $(BINDIR)/$(CONFIG)/simple_request_bad_client_test
slice_hash_table_test: $(BINDIR)/$(CONFIG)/slice_hash_table_test
slice_weak_hash_table_test: $(BINDIR)/$(CONFIG)/slice_weak_hash_table_test
ssl_server_fuzzer: $(BINDIR)/$(CONFIG)/ssl_server_fuzzer
static_metadata_test: $(BINDIR)/$(CONFIG)/static_metadata_test
stats_test: $(BINDIR)/$(CONFIG)/stats_test
Expand Down Expand Up @@ -1635,8 +1633,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/settings_timeout_test \
$(BINDIR)/$(CONFIG)/shutdown_test \
$(BINDIR)/$(CONFIG)/simple_request_bad_client_test \
$(BINDIR)/$(CONFIG)/slice_hash_table_test \
$(BINDIR)/$(CONFIG)/slice_weak_hash_table_test \
$(BINDIR)/$(CONFIG)/static_metadata_test \
$(BINDIR)/$(CONFIG)/stats_test \
$(BINDIR)/$(CONFIG)/status_metadata_test \
Expand Down Expand Up @@ -1794,8 +1790,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/settings_timeout_test \
$(BINDIR)/$(CONFIG)/shutdown_test \
$(BINDIR)/$(CONFIG)/simple_request_bad_client_test \
$(BINDIR)/$(CONFIG)/slice_hash_table_test \
$(BINDIR)/$(CONFIG)/slice_weak_hash_table_test \
$(BINDIR)/$(CONFIG)/static_metadata_test \
$(BINDIR)/$(CONFIG)/stats_test \
$(BINDIR)/$(CONFIG)/status_metadata_test \
Expand Down Expand Up @@ -2314,10 +2308,6 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/shutdown_test || ( echo test shutdown_test failed ; exit 1 )
$(E) "[RUN] Testing simple_request_bad_client_test"
$(Q) $(BINDIR)/$(CONFIG)/simple_request_bad_client_test || ( echo test simple_request_bad_client_test failed ; exit 1 )
$(E) "[RUN] Testing slice_hash_table_test"
$(Q) $(BINDIR)/$(CONFIG)/slice_hash_table_test || ( echo test slice_hash_table_test failed ; exit 1 )
$(E) "[RUN] Testing slice_weak_hash_table_test"
$(Q) $(BINDIR)/$(CONFIG)/slice_weak_hash_table_test || ( echo test slice_weak_hash_table_test failed ; exit 1 )
$(E) "[RUN] Testing static_metadata_test"
$(Q) $(BINDIR)/$(CONFIG)/static_metadata_test || ( echo test static_metadata_test failed ; exit 1 )
$(E) "[RUN] Testing stats_test"
Expand Down Expand Up @@ -3985,7 +3975,6 @@ LIBGRPC_SRC = \
src/core/lib/security/transport/secure_endpoint.cc \
src/core/lib/security/transport/security_handshaker.cc \
src/core/lib/security/transport/server_auth_filter.cc \
src/core/lib/security/transport/target_authority_table.cc \
src/core/lib/security/transport/tsi_error.cc \
src/core/lib/security/util/json_util.cc \
src/core/lib/slice/b64.cc \
Expand Down Expand Up @@ -4014,6 +4003,7 @@ LIBGRPC_SRC = \
src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \
Expand Down Expand Up @@ -4612,6 +4602,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/version.cc \
src/core/lib/transport/authority_override.cc \
src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \
Expand Down Expand Up @@ -17873,92 +17864,6 @@ endif
endif


SLICE_HASH_TABLE_TEST_SRC = \
test/core/slice/slice_hash_table_test.cc \

SLICE_HASH_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_HASH_TABLE_TEST_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/slice_hash_table_test: openssl_dep_error

else




ifeq ($(NO_PROTOBUF),true)

# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.12.0+.

$(BINDIR)/$(CONFIG)/slice_hash_table_test: protobuf_dep_error

else

$(BINDIR)/$(CONFIG)/slice_hash_table_test: $(PROTOBUF_DEP) $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/slice_hash_table_test

endif

endif

$(OBJDIR)/$(CONFIG)/test/core/slice/slice_hash_table_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a

deps_slice_hash_table_test: $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep)
endif
endif


SLICE_WEAK_HASH_TABLE_TEST_SRC = \
test/core/slice/slice_weak_hash_table_test.cc \

SLICE_WEAK_HASH_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_WEAK_HASH_TABLE_TEST_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/slice_weak_hash_table_test: openssl_dep_error

else




ifeq ($(NO_PROTOBUF),true)

# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.12.0+.

$(BINDIR)/$(CONFIG)/slice_weak_hash_table_test: protobuf_dep_error

else

$(BINDIR)/$(CONFIG)/slice_weak_hash_table_test: $(PROTOBUF_DEP) $(SLICE_WEAK_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(SLICE_WEAK_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/slice_weak_hash_table_test

endif

endif

$(OBJDIR)/$(CONFIG)/test/core/slice/slice_weak_hash_table_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libaddress_sorting.a $(LIBDIR)/$(CONFIG)/libupb.a

deps_slice_weak_hash_table_test: $(SLICE_WEAK_HASH_TABLE_TEST_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SLICE_WEAK_HASH_TABLE_TEST_OBJS:.o=.dep)
endif
endif


SSL_SERVER_FUZZER_SRC = \
test/core/security/ssl_server_fuzzer.cc \
test/core/util/fuzzer_corpus_test.cc \
Expand Down Expand Up @@ -20245,7 +20150,6 @@ src/core/lib/security/transport/client_auth_filter.cc: $(OPENSSL_DEP)
src/core/lib/security/transport/secure_endpoint.cc: $(OPENSSL_DEP)
src/core/lib/security/transport/security_handshaker.cc: $(OPENSSL_DEP)
src/core/lib/security/transport/server_auth_filter.cc: $(OPENSSL_DEP)
src/core/lib/security/transport/target_authority_table.cc: $(OPENSSL_DEP)
src/core/lib/security/transport/tsi_error.cc: $(OPENSSL_DEP)
src/core/lib/security/util/json_util.cc: $(OPENSSL_DEP)
src/core/lib/surface/init_secure.cc: $(OPENSSL_DEP)
Expand Down
Loading

0 comments on commit 60283a1

Please sign in to comment.