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 <[email protected]>
  • Loading branch information
stdpain committed Jul 12, 2024
1 parent 5de7f8a commit bff316c
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 20 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
9 changes: 2 additions & 7 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,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

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 +555,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
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
Loading

0 comments on commit bff316c

Please sign in to comment.