From ce23a444e5131e5e287b9a73afd4ee9da7665439 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Wed, 25 Oct 2023 17:05:24 +0800 Subject: [PATCH 1/4] Update aws sdk to 1.11.186 --- .gitmodules | 4 +-- contrib/aws | 2 +- contrib/aws-c-auth | 2 +- contrib/aws-c-cal | 2 +- contrib/aws-c-common | 2 +- contrib/aws-c-compression | 2 +- contrib/aws-c-event-stream | 2 +- contrib/aws-c-http | 2 +- contrib/aws-c-io | 2 +- contrib/aws-c-mqtt | 2 +- contrib/aws-c-s3 | 2 +- contrib/aws-c-sdkutils | 2 +- contrib/aws-checksums | 2 +- contrib/aws-cmake/CMakeLists.txt | 49 ++++++++++++++++++++++++++++++-- contrib/aws-crt-cpp | 2 +- contrib/aws-s2n-tls | 2 +- 16 files changed, 62 insertions(+), 19 deletions(-) diff --git a/.gitmodules b/.gitmodules index 04fe954f623..a1c0762a723 100644 --- a/.gitmodules +++ b/.gitmodules @@ -94,13 +94,13 @@ url = https://github.com/guanzhi/GmSSL.git [submodule "contrib/aws"] path = contrib/aws - url = https://github.com/JaySon-Huang/aws-sdk-cpp.git + url = https://github.com/aws/aws-sdk-cpp.git [submodule "contrib/aws-c-auth"] path = contrib/aws-c-auth url = https://github.com/awslabs/aws-c-auth.git [submodule "contrib/aws-c-cal"] path = contrib/aws-c-cal - url = https://github.com/ClickHouse/aws-c-cal.git + url = https://github.com/awslabs/aws-c-cal.git [submodule "contrib/aws-c-common"] path = contrib/aws-c-common url = https://github.com/awslabs/aws-c-common.git diff --git a/contrib/aws b/contrib/aws index 7587c2cb67e..a845f02457a 160000 --- a/contrib/aws +++ b/contrib/aws @@ -1 +1 @@ -Subproject commit 7587c2cb67e446bc42009f81acc77de6f40f5472 +Subproject commit a845f02457a9806d0678ffd11d47dfae5fbf7f21 diff --git a/contrib/aws-c-auth b/contrib/aws-c-auth index dd505b55fd4..c75e00804da 160000 --- a/contrib/aws-c-auth +++ b/contrib/aws-c-auth @@ -1 +1 @@ -Subproject commit dd505b55fd46222834f35c6e54165d8cbebbfaaa +Subproject commit c75e00804da02fef8275b29509bd7180cb7e4667 diff --git a/contrib/aws-c-cal b/contrib/aws-c-cal index 85dd7664b78..a916a84ec07 160000 --- a/contrib/aws-c-cal +++ b/contrib/aws-c-cal @@ -1 +1 @@ -Subproject commit 85dd7664b786a389c6fb1a6f031ab4bb2282133d +Subproject commit a916a84ec07d028fa7d8c09d4aecaa81df7e8a23 diff --git a/contrib/aws-c-common b/contrib/aws-c-common index 50695e94809..4c0a9f579d3 160000 --- a/contrib/aws-c-common +++ b/contrib/aws-c-common @@ -1 +1 @@ -Subproject commit 50695e948092579e1455623b5cc2ba7e511a3990 +Subproject commit 4c0a9f579d3064f086b42a2d39aaea721e7e71ca diff --git a/contrib/aws-c-compression b/contrib/aws-c-compression index b517b7decd0..99ec79ee297 160000 --- a/contrib/aws-c-compression +++ b/contrib/aws-c-compression @@ -1 +1 @@ -Subproject commit b517b7decd0dac30be2162f5186c250221c53aff +Subproject commit 99ec79ee2970f1a045d4ced1501b97ee521f2f85 diff --git a/contrib/aws-c-event-stream b/contrib/aws-c-event-stream index 2f9b60c42f9..08f24e384e5 160000 --- a/contrib/aws-c-event-stream +++ b/contrib/aws-c-event-stream @@ -1 +1 @@ -Subproject commit 2f9b60c42f90840ec11822acda3d8cdfa97a773d +Subproject commit 08f24e384e5be20bcffa42b49213d24dad7881ae diff --git a/contrib/aws-c-http b/contrib/aws-c-http index 99894610086..d777859b6da 160000 --- a/contrib/aws-c-http +++ b/contrib/aws-c-http @@ -1 +1 @@ -Subproject commit 99894610086372df1cf09d62b9eafca42eb53f5b +Subproject commit d777859b6da179b9098f87a2077fbf2129b574dc diff --git a/contrib/aws-c-io b/contrib/aws-c-io index f2ff573c191..c9cb77747d3 160000 --- a/contrib/aws-c-io +++ b/contrib/aws-c-io @@ -1 +1 @@ -Subproject commit f2ff573c191e1c4ea0248af5c08161356be3bc78 +Subproject commit c9cb77747d3fd2809cf3d9c43be7d5decc17e4b3 diff --git a/contrib/aws-c-mqtt b/contrib/aws-c-mqtt index 5cbde90916a..0cc50d15827 160000 --- a/contrib/aws-c-mqtt +++ b/contrib/aws-c-mqtt @@ -1 +1 @@ -Subproject commit 5cbde90916a1f9945e2a1ef36f3db58e1c976167 +Subproject commit 0cc50d1582719c9f3b55539139015fc86965bb6f diff --git a/contrib/aws-c-s3 b/contrib/aws-c-s3 index 91e03c1875f..1fe34646f6b 160000 --- a/contrib/aws-c-s3 +++ b/contrib/aws-c-s3 @@ -1 +1 @@ -Subproject commit 91e03c1875f8c28a71744d75b980336191f096e2 +Subproject commit 1fe34646f6bb2282491077b1d2407c724c0d5471 diff --git a/contrib/aws-c-sdkutils b/contrib/aws-c-sdkutils index 208a701fa01..a6fd80cf7c1 160000 --- a/contrib/aws-c-sdkutils +++ b/contrib/aws-c-sdkutils @@ -1 +1 @@ -Subproject commit 208a701fa01e99c7c8cc3dcebc8317da71362972 +Subproject commit a6fd80cf7c163062d31abb28f309e47330fbfc17 diff --git a/contrib/aws-checksums b/contrib/aws-checksums index ad53be196a2..321b805559c 160000 --- a/contrib/aws-checksums +++ b/contrib/aws-checksums @@ -1 +1 @@ -Subproject commit ad53be196a25bbefa3700a01187fdce573a7d2d0 +Subproject commit 321b805559c8e911be5bddba13fcbd222a3e2d3a diff --git a/contrib/aws-cmake/CMakeLists.txt b/contrib/aws-cmake/CMakeLists.txt index a729c6a48fb..cf4b1dba50c 100644 --- a/contrib/aws-cmake/CMakeLists.txt +++ b/contrib/aws-cmake/CMakeLists.txt @@ -12,7 +12,8 @@ set(AWS_PUBLIC_COMPILE_DEFS) set(AWS_PRIVATE_COMPILE_DEFS) set(AWS_PRIVATE_LIBS) -list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DENABLE_CURL_CLIENT") +# ignore the symbols defined in `aws/common/external/ittnotify.h` +list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DENABLE_CURL_CLIENT -DINTEL_NO_ITTNOTIFY_API") if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG") list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DDEBUG_BUILD") @@ -70,9 +71,12 @@ file(GLOB AWS_SDK_CORE_SRC "${AWS_SDK_CORE_DIR}/source/monitoring/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/base64/*.cpp" + "${AWS_SDK_CORE_DIR}/source/utils/component-registry/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/crypto/*.cpp" - "${AWS_SDK_CORE_DIR}/source/utils/crypto/openssl/*.cpp" + # "${AWS_SDK_CORE_DIR}/source/utils/crypto/bcrypt/*.cpp" + # "${AWS_SDK_CORE_DIR}/source/utils/crypto/commoncrypto/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/crypto/factory/*.cpp" + "${AWS_SDK_CORE_DIR}/source/utils/crypto/openssl/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/event/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/json/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/logging/*.cpp" @@ -81,6 +85,8 @@ file(GLOB AWS_SDK_CORE_SRC "${AWS_SDK_CORE_DIR}/source/utils/stream/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/threading/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/xml/*.cpp" + "${AWS_SDK_CORE_DIR}/source/smithy/*.cpp" + "${AWS_SDK_CORE_DIR}/source/smithy/tracing/*.cpp" ) if(OS_LINUX OR OS_DARWIN) @@ -138,6 +144,41 @@ list(APPEND AWS_PUBLIC_INCLUDES "${AWS_AUTH_DIR}/include/") file(GLOB AWS_CAL_SRC "${AWS_CAL_DIR}/source/*.c" ) +if (WIN32) +elseif (OS_DARWIN) + file(GLOB AWS_CAL_OS_SRC + "${AWS_CAL_DIR}/source/darwin/*.c" + ) + + find_library(SECURITY_LIB Security) + if (NOT SECURITY_LIB) + message(FATAL_ERROR "Security Framework not found") + endif () + + list(APPEND PLATFORM_LIBS "-framework Security") +else (OS_LINUX) + file(GLOB AWS_CAL_OS_SRC + "${AWS_CAL_DIR}/source/unix/*.c" + ) + if (ENABLE_OPENSSL_ENCRYPTION AND NOT ANDROID) + find_package(OpenSSL REQUIRED) + find_package(Threads REQUIRED) + set(PLATFORM_LIBS OpenSSL::Crypto Threads::Threads) + message(STATUS "Using libcrypto from system: ${OPENSSL_CRYPTO_LIBRARY}") + elseif(NOT ENABLE_OPENSSL_ENCRYPTION AND IN_SOURCE_BUILD) + if (TARGET crypto) + message(STATUS "Using libcrypto from AWS-LC") + else() + message(FATAL_ERROR "Target crypto is not defined, failed to find libcrypto.") + endif() + set(PLATFORM_LIBS crypto) + else() + # note aws_use_package() does this for you, except it appends to the public link targets + # which we probably don't want for this case where we want the crypto dependency private + find_package(crypto REQUIRED) + set(PLATFORM_LIBS AWS::crypto) + endif() +endif () if (ENABLE_OPENSSL_ENCRYPTION) file(GLOB AWS_CAL_OS_SRC @@ -248,6 +289,7 @@ elseif (OS_DARWIN) file(GLOB AWS_IO_OS_SRC "${AWS_IO_DIR}/source/bsd/*.c" "${AWS_IO_DIR}/source/posix/*.c" + "${AWS_IO_DIR}/source/darwin/*.c" ) endif() @@ -290,13 +332,13 @@ file(GLOB AWS_CRT_SRC "${AWS_CRT_DIR}/source/auth/*.cpp" "${AWS_CRT_DIR}/source/crypto/*.cpp" "${AWS_CRT_DIR}/source/endpoints/*.cpp" - "${AWS_CRT_DIR}/source/external/*.cpp" "${AWS_CRT_DIR}/source/http/*.cpp" "${AWS_CRT_DIR}/source/io/*.cpp" ) list(APPEND AWS_SOURCES ${AWS_CRT_SRC}) list(APPEND AWS_PUBLIC_INCLUDES "${AWS_CRT_DIR}/include/") +configure_file("${AWS_CRT_DIR}/include/aws/crt/Config.h.in" ${CMAKE_CURRENT_BINARY_DIR}/include/aws/crt/Config.h @ONLY) # aws-c-mqtt @@ -351,6 +393,7 @@ target_include_directories(_aws SYSTEM BEFORE PUBLIC ${AWS_PUBLIC_INCLUDES}) target_include_directories(_aws SYSTEM BEFORE PRIVATE ${AWS_PRIVATE_INCLUDES}) target_compile_definitions(_aws PUBLIC ${AWS_PUBLIC_COMPILE_DEFS}) target_compile_definitions(_aws PRIVATE ${AWS_PRIVATE_COMPILE_DEFS}) + target_link_libraries(_aws PRIVATE ${AWS_PRIVATE_LIBS}) target_no_warning(_aws deprecated-declarations) target_no_warning(_aws implicit-function-declaration) diff --git a/contrib/aws-crt-cpp b/contrib/aws-crt-cpp index 7ff9e0343c9..b381d68ce61 160000 --- a/contrib/aws-crt-cpp +++ b/contrib/aws-crt-cpp @@ -1 +1 @@ -Subproject commit 7ff9e0343c978fc54f440b98147c2f72d304f6d8 +Subproject commit b381d68ce6177443fb427f3e8fbcdc549b1de0bf diff --git a/contrib/aws-s2n-tls b/contrib/aws-s2n-tls index 0725d3c0bb5..4654fecb05c 160000 --- a/contrib/aws-s2n-tls +++ b/contrib/aws-s2n-tls @@ -1 +1 @@ -Subproject commit 0725d3c0bb5bc1383310e19dd94c821a9234d299 +Subproject commit 4654fecb05cd5aacbda262654eb95a3876183698 From 4c74a9a3da390731f9c03496ee5c93870bd64a22 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Wed, 25 Oct 2023 18:33:03 +0800 Subject: [PATCH 2/4] try on mac Signed-off-by: JaySon-Huang --- contrib/aws-cmake/CMakeLists.txt | 83 ++++++++------------------------ 1 file changed, 19 insertions(+), 64 deletions(-) diff --git a/contrib/aws-cmake/CMakeLists.txt b/contrib/aws-cmake/CMakeLists.txt index cf4b1dba50c..6e4971f6dea 100644 --- a/contrib/aws-cmake/CMakeLists.txt +++ b/contrib/aws-cmake/CMakeLists.txt @@ -29,6 +29,11 @@ if (USE_S2N) list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DUSE_S2N") endif() +# Versions +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MAJOR=1") +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MINOR=11") +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_PATCH=186") + # Directories. SET(AWS_SDK_DIR "${TiFlash_SOURCE_DIR}/contrib/aws") SET(AWS_SDK_CORE_DIR "${AWS_SDK_DIR}/src/aws-cpp-sdk-core") @@ -49,7 +54,6 @@ SET(AWS_S2N_TLS_DIR "${TiFlash_SOURCE_DIR}/contrib/aws-s2n-tls") SET(AWS_S3_DIR "${TiFlash_SOURCE_DIR}/contrib/aws-c-s3") SET(AWS_SDKUTILS_DIR "${TiFlash_SOURCE_DIR}/contrib/aws-c-sdkutils") - # aws-cpp-sdk-core file(GLOB AWS_SDK_CORE_SRC "${AWS_SDK_CORE_DIR}/source/*.cpp" @@ -65,16 +69,16 @@ file(GLOB AWS_SDK_CORE_SRC "${AWS_SDK_CORE_DIR}/source/external/cjson/*.cpp" "${AWS_SDK_CORE_DIR}/source/external/tinyxml2/*.cpp" "${AWS_SDK_CORE_DIR}/source/http/*.cpp" - "${AWS_SDK_CORE_DIR}/source/http/standard/*.cpp" "${AWS_SDK_CORE_DIR}/source/http/curl/*.cpp" + "${AWS_SDK_CORE_DIR}/source/http/standard/*.cpp" "${AWS_SDK_CORE_DIR}/source/internal/*.cpp" "${AWS_SDK_CORE_DIR}/source/monitoring/*.cpp" + "${AWS_SDK_CORE_DIR}/source/smithy/*.cpp" + "${AWS_SDK_CORE_DIR}/source/smithy/tracing/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/base64/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/component-registry/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/crypto/*.cpp" - # "${AWS_SDK_CORE_DIR}/source/utils/crypto/bcrypt/*.cpp" - # "${AWS_SDK_CORE_DIR}/source/utils/crypto/commoncrypto/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/crypto/factory/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/crypto/openssl/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/event/*.cpp" @@ -85,8 +89,6 @@ file(GLOB AWS_SDK_CORE_SRC "${AWS_SDK_CORE_DIR}/source/utils/stream/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/threading/*.cpp" "${AWS_SDK_CORE_DIR}/source/utils/xml/*.cpp" - "${AWS_SDK_CORE_DIR}/source/smithy/*.cpp" - "${AWS_SDK_CORE_DIR}/source/smithy/tracing/*.cpp" ) if(OS_LINUX OR OS_DARWIN) @@ -101,10 +103,6 @@ OPTION(USE_AWS_MEMORY_MANAGEMENT "Aws memory management" OFF) configure_file("${AWS_SDK_CORE_DIR}/include/aws/core/SDKConfig.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/aws/core/SDKConfig.h" @ONLY) -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MAJOR=1") -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MINOR=10") -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_PATCH=36") - list(APPEND AWS_SOURCES ${AWS_SDK_CORE_SRC} ${AWS_SDK_CORE_NET_SRC} ${AWS_SDK_CORE_PLATFORM_SRC}) list(APPEND AWS_PUBLIC_INCLUDES @@ -144,43 +142,10 @@ list(APPEND AWS_PUBLIC_INCLUDES "${AWS_AUTH_DIR}/include/") file(GLOB AWS_CAL_SRC "${AWS_CAL_DIR}/source/*.c" ) -if (WIN32) -elseif (OS_DARWIN) - file(GLOB AWS_CAL_OS_SRC - "${AWS_CAL_DIR}/source/darwin/*.c" - ) - - find_library(SECURITY_LIB Security) - if (NOT SECURITY_LIB) - message(FATAL_ERROR "Security Framework not found") - endif () - - list(APPEND PLATFORM_LIBS "-framework Security") -else (OS_LINUX) - file(GLOB AWS_CAL_OS_SRC - "${AWS_CAL_DIR}/source/unix/*.c" - ) - if (ENABLE_OPENSSL_ENCRYPTION AND NOT ANDROID) - find_package(OpenSSL REQUIRED) - find_package(Threads REQUIRED) - set(PLATFORM_LIBS OpenSSL::Crypto Threads::Threads) - message(STATUS "Using libcrypto from system: ${OPENSSL_CRYPTO_LIBRARY}") - elseif(NOT ENABLE_OPENSSL_ENCRYPTION AND IN_SOURCE_BUILD) - if (TARGET crypto) - message(STATUS "Using libcrypto from AWS-LC") - else() - message(FATAL_ERROR "Target crypto is not defined, failed to find libcrypto.") - endif() - set(PLATFORM_LIBS crypto) - else() - # note aws_use_package() does this for you, except it appends to the public link targets - # which we probably don't want for this case where we want the crypto dependency private - find_package(crypto REQUIRED) - set(PLATFORM_LIBS AWS::crypto) - endif() -endif () if (ENABLE_OPENSSL_ENCRYPTION) + # Note: We use `unix/*.c` for both OS_LINUX and OS_DARWIN + # `darwin/*.c` lead to compile errors file(GLOB AWS_CAL_OS_SRC "${AWS_CAL_DIR}/source/unix/*.c" ) @@ -211,6 +176,9 @@ file(GLOB AWS_COMMON_ARCH_SRC "${AWS_COMMON_DIR}/source/arch/generic/*.c" ) +## Note: These arch optimization are ineffective now, the variables +## defined for AWS is not translated to the variables for TiFlash +# arch optimization begin if (AWS_ARCH_INTEL) file(GLOB AWS_COMMON_ARCH_SRC "${AWS_COMMON_DIR}/source/arch/intel/cpuid.c" @@ -229,7 +197,7 @@ if (HAVE_AVX2_INTRINSICS) list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DUSE_SIMD_ENCODING") set(AWS_COMMON_AVX2_SRC "${AWS_COMMON_DIR}/source/arch/intel/encoding_avx2.c") set_source_files_properties(${AWS_COMMON_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${AVX2_CFLAGS}") -endif() +endif() # arch optimization ends configure_file("${AWS_COMMON_DIR}/include/aws/common/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/aws/common/config.h" @ONLY) @@ -250,25 +218,11 @@ file(GLOB AWS_CHECKSUMS_SRC "${AWS_CHECKSUMS_DIR}/source/arm/*.c" ) -if(AWS_ARCH_INTEL AND AWS_HAVE_GCC_INLINE_ASM) - file(GLOB AWS_CHECKSUMS_ARCH_SRC - "${AWS_CHECKSUMS_DIR}/source/intel/asm/*.c" - ) -endif() - -if (AWS_ARCH_ARM64) +if (ARCH_AARCH64) file(GLOB AWS_CHECKSUMS_ARCH_SRC "${AWS_CHECKSUMS_DIR}/source/arm/*.c" ) set_source_files_properties("${AWS_CHECKSUMS_DIR}/source/arm/crc32c_arm.c" PROPERTIES COMPILE_FLAGS -march=armv8-a+crc) -elseif (AWS_ARCH_ARM32) - if (AWS_ARM32_CRC) - file(GLOB AWS_CHECKSUMS_ARCH_SRC - "${AWS_CHECKSUMS_DIR}/source/arm/*.c" - "${AWS_CHECKSUMS_DIR}/source/arm/asm/*.c" - ) - set_source_files_properties(source/arm/crc32c_arm.c PROPERTIES COMPILE_FLAGS -march=armv8-a+crc) - endif() endif() list(APPEND AWS_SOURCES ${AWS_CHECKSUMS_SRC} ${AWS_CHECKSUMS_ARCH_SRC}) @@ -289,7 +243,8 @@ elseif (OS_DARWIN) file(GLOB AWS_IO_OS_SRC "${AWS_IO_DIR}/source/bsd/*.c" "${AWS_IO_DIR}/source/posix/*.c" - "${AWS_IO_DIR}/source/darwin/*.c" + # Note darwin source files leads to compile errors, ignore them + # "${AWS_IO_DIR}/source/darwin/*.c" ) endif() @@ -338,7 +293,8 @@ file(GLOB AWS_CRT_SRC list(APPEND AWS_SOURCES ${AWS_CRT_SRC}) list(APPEND AWS_PUBLIC_INCLUDES "${AWS_CRT_DIR}/include/") -configure_file("${AWS_CRT_DIR}/include/aws/crt/Config.h.in" ${CMAKE_CURRENT_BINARY_DIR}/include/aws/crt/Config.h @ONLY) +configure_file("${AWS_CRT_DIR}/include/aws/crt/Config.h.in" + ${CMAKE_CURRENT_BINARY_DIR}/include/aws/crt/Config.h @ONLY) # aws-c-mqtt @@ -393,7 +349,6 @@ target_include_directories(_aws SYSTEM BEFORE PUBLIC ${AWS_PUBLIC_INCLUDES}) target_include_directories(_aws SYSTEM BEFORE PRIVATE ${AWS_PRIVATE_INCLUDES}) target_compile_definitions(_aws PUBLIC ${AWS_PUBLIC_COMPILE_DEFS}) target_compile_definitions(_aws PRIVATE ${AWS_PRIVATE_COMPILE_DEFS}) - target_link_libraries(_aws PRIVATE ${AWS_PRIVATE_LIBS}) target_no_warning(_aws deprecated-declarations) target_no_warning(_aws implicit-function-declaration) From 860de1cfc065885dfddc921ee17e9f8d73beba60 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Wed, 25 Oct 2023 19:20:16 +0800 Subject: [PATCH 3/4] cleanup Signed-off-by: JaySon-Huang --- contrib/aws-cmake/CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/aws-cmake/CMakeLists.txt b/contrib/aws-cmake/CMakeLists.txt index 6e4971f6dea..31504b0aad3 100644 --- a/contrib/aws-cmake/CMakeLists.txt +++ b/contrib/aws-cmake/CMakeLists.txt @@ -12,6 +12,11 @@ set(AWS_PUBLIC_COMPILE_DEFS) set(AWS_PRIVATE_COMPILE_DEFS) set(AWS_PRIVATE_LIBS) +# Versions +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MAJOR=1") +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MINOR=11") +list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_PATCH=186") + # ignore the symbols defined in `aws/common/external/ittnotify.h` list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DENABLE_CURL_CLIENT -DINTEL_NO_ITTNOTIFY_API") @@ -29,11 +34,6 @@ if (USE_S2N) list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DUSE_S2N") endif() -# Versions -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MAJOR=1") -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MINOR=11") -list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_PATCH=186") - # Directories. SET(AWS_SDK_DIR "${TiFlash_SOURCE_DIR}/contrib/aws") SET(AWS_SDK_CORE_DIR "${AWS_SDK_DIR}/src/aws-cpp-sdk-core") @@ -176,9 +176,6 @@ file(GLOB AWS_COMMON_ARCH_SRC "${AWS_COMMON_DIR}/source/arch/generic/*.c" ) -## Note: These arch optimization are ineffective now, the variables -## defined for AWS is not translated to the variables for TiFlash -# arch optimization begin if (AWS_ARCH_INTEL) file(GLOB AWS_COMMON_ARCH_SRC "${AWS_COMMON_DIR}/source/arch/intel/cpuid.c" @@ -197,7 +194,7 @@ if (HAVE_AVX2_INTRINSICS) list(APPEND AWS_PRIVATE_COMPILE_DEFS "-DUSE_SIMD_ENCODING") set(AWS_COMMON_AVX2_SRC "${AWS_COMMON_DIR}/source/arch/intel/encoding_avx2.c") set_source_files_properties(${AWS_COMMON_AVX2_SRC} PROPERTIES COMPILE_FLAGS "${AVX2_CFLAGS}") -endif() # arch optimization ends +endif() configure_file("${AWS_COMMON_DIR}/include/aws/common/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/aws/common/config.h" @ONLY) @@ -213,12 +210,15 @@ list(APPEND AWS_PUBLIC_INCLUDES # aws-checksums file(GLOB AWS_CHECKSUMS_SRC "${AWS_CHECKSUMS_DIR}/source/*.c" - "${AWS_CHECKSUMS_DIR}/source/intel/*.c" - "${AWS_CHECKSUMS_DIR}/source/intel/asm/*.c" - "${AWS_CHECKSUMS_DIR}/source/arm/*.c" ) -if (ARCH_AARCH64) +if(AWS_ARCH_INTEL AND AWS_HAVE_GCC_INLINE_ASM) + file(GLOB AWS_CHECKSUMS_ARCH_SRC + "${AWS_CHECKSUMS_DIR}/source/intel/asm/*.c" + ) +endif() + +if (AWS_ARCH_ARM64) file(GLOB AWS_CHECKSUMS_ARCH_SRC "${AWS_CHECKSUMS_DIR}/source/arm/*.c" ) From d0788aa168e3ef9396bf0008a8e05678f39d4470 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Mon, 30 Oct 2023 17:32:16 +0800 Subject: [PATCH 4/4] Refine the log level for exit signals --- dbms/src/Server/Server.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 61c20b97eed..25fc95c98d5 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -705,12 +705,13 @@ class Server::TcpHttpServersHolder server->start(); } + // terminate all TCP servers when receive exit signal void onExit() { auto & config = server.config(); - LOG_DEBUG(log, "Received termination signal."); - LOG_DEBUG(log, "Waiting for current connections to close."); + LOG_INFO(log, "Received termination signal, stopping server..."); + LOG_INFO(log, "Waiting for current connections to close."); int current_connections = 0; for (auto & server : servers) @@ -718,15 +719,11 @@ class Server::TcpHttpServersHolder server->stop(); current_connections += server->currentConnections(); } - String debug_msg = "Closed all listening sockets."; - - if (current_connections) - LOG_DEBUG(log, "{} Waiting for {} outstanding connections.", debug_msg, current_connections); - else - LOG_DEBUG(log, debug_msg); + String debug_msg = "Closed all listening sockets."; if (current_connections) { + LOG_INFO(log, "{} Waiting for {} outstanding connections.", debug_msg, current_connections); const int sleep_max_ms = 1000 * config.getInt("shutdown_wait_unfinished", 5); const int sleep_one_ms = 100; int sleep_current_ms = 0; @@ -741,18 +738,21 @@ class Server::TcpHttpServersHolder std::this_thread::sleep_for(std::chrono::milliseconds(sleep_one_ms)); } } + else + { + LOG_INFO(log, debug_msg); + } debug_msg = "Closed connections."; - if (current_connections) - LOG_DEBUG( + LOG_INFO( log, "{} But {} remains." " Tip: To increase wait time add to config: 60", debug_msg, current_connections); else - LOG_DEBUG(log, debug_msg); + LOG_INFO(log, debug_msg); } private: