Skip to content

Commit

Permalink
[Enhancement] upgrade some thirdparty
Browse files Browse the repository at this point in the history
upgrade brpc to 1.9.0
upgrade glog to 0.7.1

brpc has support thrift extends https://github.com/apache/brpc/blob/master/docs/en/thrift.md
we could use brpc async interface instead of using thread pool simulate an async interface

glog has support change vlog level dynamic in google/glog#650

Signed-off-by: stdpain <drfeng08@gmail.com>
  • Loading branch information
stdpain committed Jul 12, 2024
1 parent 5de7f8a commit 7c468c9
Show file tree
Hide file tree
Showing 7 changed files with 368 additions and 41 deletions.
2 changes: 0 additions & 2 deletions be/src/service/service_be/starrocks_be.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ void start_be(const std::vector<StorePath>& paths, bool as_cn) {
brpc::FLAGS_max_body_size = config::brpc_max_body_size;

// Configure keepalive.
#ifdef WITH_BRPC_KEEPALIVE
brpc::FLAGS_socket_keepalive = config::brpc_socket_keepalive;
#endif

brpc::FLAGS_socket_max_unwritten_bytes = config::brpc_socket_max_unwritten_bytes;
auto brpc_server = std::make_unique<brpc::Server>();
Expand Down
3 changes: 0 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ WITH_GCOV=OFF
WITH_BENCH=OFF
WITH_CLANG_TIDY=OFF
WITH_STARCACHE=ON
WITH_BRPC_KEEPALIVE=OFF
USE_STAROS=OFF
BUILD_JAVA_EXT=ON
OUTPUT_COMPILE_TIME=OFF
Expand Down Expand Up @@ -236,7 +235,6 @@ else
--with-clang-tidy) WITH_CLANG_TIDY=ON; shift ;;
--without-java-ext) BUILD_JAVA_EXT=OFF; shift ;;
--without-starcache) WITH_STARCACHE=OFF; shift ;;
--with-brpc-keepalive) WITH_BRPC_KEEPALIVE=ON; shift ;;
--output-compile-time) OUTPUT_COMPILE_TIME=ON; shift ;;
-h) HELP=1; shift ;;
--help) HELP=1; shift ;;
Expand Down Expand Up @@ -372,7 +370,6 @@ if [ ${BUILD_BE} -eq 1 ] ; then
-DWITH_CLANG_TIDY=${WITH_CLANG_TIDY} \
-DWITH_COMPRESS=${WITH_COMPRESS} \
-DWITH_STARCACHE=${WITH_STARCACHE} \
-DWITH_BRPC_KEEPALIVE=${WITH_BRPC_KEEPALIVE} \
-DUSE_STAROS=${USE_STAROS} \
-DENABLE_FAULT_INJECTION=${ENABLE_FAULT_INJECTION} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
Expand Down
33 changes: 5 additions & 28 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ cd $TP_DIR
# Download thirdparties.
${TP_DIR}/download-thirdparty.sh

TP_INSTALL_DIR=/root/starrocks/thirdparty/installed/
STARROCKS_GCC_HOME=/

# set COMPILER
if [[ ! -z ${STARROCKS_GCC_HOME} ]]; then
export CC=${STARROCKS_GCC_HOME}/bin/gcc
Expand Down Expand Up @@ -368,13 +371,8 @@ build_glog() {
check_if_source_exist $GLOG_SOURCE
cd $TP_SOURCE_DIR/$GLOG_SOURCE

# to generate config.guess and config.sub to support aarch64
rm -rf config.*
autoreconf -i
$CMAKE_CMD -G "${CMAKE_GENERATOR}" -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DDCMAKE_INSTALL_LIBDIR=lib

LDFLAGS="-L${TP_LIB_DIR}" \
CPPFLAGS="-I${TP_INCLUDE_DIR}" \
./configure --prefix=$TP_INSTALL_DIR --enable-frame-pointers --disable-shared --enable-static
make -j$PARALLEL
make install
}
Expand Down Expand Up @@ -560,7 +558,7 @@ build_brpc() {
cd $TP_SOURCE_DIR/$BRPC_SOURCE
CMAKE_GENERATOR="Unix Makefiles"
BUILD_SYSTEM='make'
./config_brpc.sh --headers="$TP_INSTALL_DIR/include /usr/include" --libs="$TP_INSTALL_DIR/bin $TP_INSTALL_DIR/lib /usr/lib" --with-glog
PATH=$PATH:$TP_INSTALL_DIR/bin/ ./config_brpc.sh --headers="$TP_INSTALL_DIR/include /usr/include" --libs="$TP_INSTALL_DIR/bin $TP_INSTALL_DIR/lib /usr/lib" --with-glog --with-thrift
make -j$PARALLEL
cp -rf output/* ${TP_INSTALL_DIR}/
if [ -f $TP_INSTALL_DIR/lib/libbrpc.a ]; then
Expand Down Expand Up @@ -1347,27 +1345,6 @@ export CPPFLAGS=$GLOBAL_CPPFLAGS
export CXXFLAGS=$GLOBAL_CXXFLAGS
export CFLAGS=$GLOBAL_CFLAGS

build_libevent
build_zlib
build_lz4
build_lzo2
build_bzip
build_openssl
build_boost # must before thrift
build_protobuf
build_gflags
build_gtest
build_glog
build_rapidjson
build_simdjson
build_snappy
build_gperftools
build_curl
build_re2
build_thrift
build_leveldb
build_brpc
build_rocksdb
build_kerberos
# must build before arrow
build_sasl
Expand Down
8 changes: 8 additions & 0 deletions thirdparty/download-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ if [ ! -f $PATCHED_MARK ] && [ $GLOG_SOURCE == "glog-0.4.0" ]; then
patch -p1 < $TP_PATCH_DIR/glog-0.4.0-remove-unwind-dependency.patch
touch $PATCHED_MARK
fi
if [ ! -f $PATCHED_MARK ] && [ $GLOG_SOURCE == "glog-0.7.1" ]; then
patch -p1 < $TP_PATCH_DIR/glog-0.7.1.patch
touch $PATCHED_MARK
fi
cd -
echo "Finished patching $GLOG_SOURCE"

Expand Down Expand Up @@ -305,6 +309,10 @@ if [ ! -f $PATCHED_MARK ] && [ $BRPC_SOURCE == "brpc-1.3.0" ]; then
patch -p1 < $TP_PATCH_DIR/brpc-1.3.0-2479.patch
touch $PATCHED_MARK
fi
if [ ! -f $PATCHED_MARK ] && [ $BRPC_SOURCE == "brpc-1.9.0" ]; then
patch < $TP_PATCH_DIR/brpc-1.9.0.patch
touch $PATCHED_MARK
fi
cd -
echo "Finished patching $BRPC_SOURCE"

Expand Down
13 changes: 13 additions & 0 deletions thirdparty/patches/brpc-1.9.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/config_brpc.sh b/config_brpc.sh
index ddaa6daa..2269587a 100755
--- a/config_brpc.sh
+++ b/config_brpc.sh
@@ -341,7 +341,7 @@ if [ "$PROTOBUF_VERSION" -ge 4022000 ]; then
done
CXXFLAGS="-std=c++17"
else
- CXXFLAGS="-std=c++0x"
+ CXXFLAGS="-std=c++17"
fi

LEVELDB_HDR=$(find_dir_of_header_or_die leveldb/db.h)
Loading

0 comments on commit 7c468c9

Please sign in to comment.