Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the bundled glog to 0.7.1 and ports Doris’s custom logging behavior (log splitting, file quotas, stacktrace helper) to the new version, while ensuring all C++ consumers (BE, Cloud, brpc, s2, arrow) build correctly against the updated glog with the new export model.
Changes:
- Bump
glogfrom 0.6.0 to 0.7.1 and introducethirdparty/patches/glog-0.7.1.patchto reapply Doris-specific features (log split by size/day/hour, log file count quotas including warn-level quotas, and aDumpStackTraceToStringhelper). - Adjust third-party build and download scripts to handle
glog-0.7.1and addGLOG_USE_GLOG_EXPORTto all relevant consumers (BE, Cloud, brpc, arrow, s2), plus patch brpc to build with C++14 and to propagate the glog export define. - Update BE/Cloud CMake and a signal handler call site to align with the new
glogAPI (FlushLogFilesUnsafe(LogSeverity)), and record theglogupgrade in the thirdparty changelog.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
thirdparty/vars.sh |
Points GLOG_* variables at the new glog 0.7.1 tarball, name, source directory, and checksum so the build pulls the updated dependency. |
thirdparty/patches/glog-0.7.1.patch |
New patch porting Doris’s custom glog behavior (log splitting and rotation quotas, altered filename scheme, removal of file headers, stacktrace helper, and Flush/LogToAll adjustments) onto glog 0.7.1. |
thirdparty/patches/brpc-1.4.0-glog-export.patch |
Updates brpc’s CMakeLists.txt to add -DGLOG_USE_GLOG_EXPORT into CMAKE_CPP_FLAGS so brpc compiles correctly with the new glog export model. |
thirdparty/patches/brpc-1.4.0-cxx14.patch |
Raises brpc’s C++ standard settings from C++11 to C++14 (via -std=c++14 and CMAKE_CXX_STANDARD 14) to meet updated dependency requirements. |
thirdparty/download-thirdparty.sh |
Extends the glog patch-application logic to handle glog-0.7.1 by applying glog-0.7.1.patch when that version is selected. |
thirdparty/build-thirdparty.sh |
Updates build_glog to support building glog-0.7.1 (with the appropriate WITH_UNWIND flag) and injects -DGLOG_USE_GLOG_EXPORT into the build environments for brpc, arrow, and s2. |
thirdparty/CHANGELOG.md |
Records the glog upgrade from 0.6.0 to 0.7.1 in the thirdparty dependency changelog. |
cloud/CMakeLists.txt |
Adds -DGLOG_USE_GLOG_EXPORT alongside the existing GLOG_CUSTOM_PREFIX_SUPPORT define for Cloud C++ targets using glog. |
be/src/common/signal_handler.h |
Updates google::FlushLogFilesUnsafe usage to pass google::GLOG_INFO instead of a raw integer, matching the 0.7.x API signature and type expectations. |
be/CMakeLists.txt |
Adds -DGLOG_USE_GLOG_EXPORT for BE C++ targets to align with glog’s new export macro requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| + | ||
| + struct stat fstat; | ||
| + if (::stat(filepath.c_str(), &fstat) < 0) { | ||
| + fprintf(stderr, "state %s fail\n", filepath.c_str()); |
There was a problem hiding this comment.
The error message printed when ::stat fails contains a typo ("state %s fail") which makes the log harder to understand; please change "state" to "stat" to correctly describe the failing system call.
| + fprintf(stderr, "state %s fail\n", filepath.c_str()); | |
| + fprintf(stderr, "stat %s fail\n", filepath.c_str()); |
| GLOG_DOWNLOAD="https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz" | ||
| GLOG_NAME="glog-v0.7.1.tar.gz" | ||
| GLOG_SOURCE=glog-0.7.1 | ||
| GLOG_MD5SUM="128e2995cc33d794ff24f785a3060346" |
There was a problem hiding this comment.
GLOG_MD5SUM uses MD5 to verify the integrity of the downloaded glog tarball, which is a weak and broken hash function for security-sensitive integrity checks. An active network attacker (especially given the use of wget for remote downloads) could potentially bypass this protection by exploiting MD5 weaknesses, undermining your supply-chain integrity for this dependency. Replace the MD5-based check with a stronger hash (e.g., SHA-256) and compare against a pinned, known-good value for the archive.
| GLOG_MD5SUM="128e2995cc33d794ff24f785a3060346" | |
| GLOG_MD5SUM="" | |
| GLOG_SHA256SUM="REPLACE_WITH_ACTUAL_PINNED_SHA256_FOR_glog-v0.7.1.tar.gz" |
TPC-H: Total hot run time: 32197 ms |
ClickBench: Total hot run time: 28.28 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
GLOG_USE_GLOG_EXPORTfor glog 0.7.x consumers (BE/CLOUD build, brpc, s2, arrow build).Release note
None
Check List (For Author)
Test
./thirdparty/build-thirdparty.sh glog./thirdparty/build-thirdparty.sh brpc./thirdparty/build-thirdparty.sh arrow./thirdparty/build-thirdparty.sh s2cd be && make -j $(nproc)Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)