Skip to content

[Chore](thirdparty) upgrade glog#60439

Draft
xylaaaaa wants to merge 1 commit intoapache:masterfrom
xylaaaaa:align-glog-0.7.1
Draft

[Chore](thirdparty) upgrade glog#60439
xylaaaaa wants to merge 1 commit intoapache:masterfrom
xylaaaaa:align-glog-0.7.1

Conversation

@xylaaaaa
Copy link
Contributor

@xylaaaaa xylaaaaa commented Feb 2, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

  • Upgrade thirdparty glog from 0.6.0 to 0.7.1.
  • Port Doris custom glog patch from 0.6.0 onto 0.7.1 (log split, file quota, stack trace helper, etc.).
  • Update thirdparty download/patch flow to apply glog-0.7.1 patch.
  • Add GLOG_USE_GLOG_EXPORT for glog 0.7.x consumers (BE/CLOUD build, brpc, s2, arrow build).
  • Update brpc build to C++14 and add glog export define for compatibility with glog 0.7.x.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • ./thirdparty/build-thirdparty.sh glog
      • ./thirdparty/build-thirdparty.sh brpc
      • ./thirdparty/build-thirdparty.sh arrow
      • ./thirdparty/build-thirdparty.sh s2
      • cd be && make -j $(nproc)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Copilot AI review requested due to automatic review settings February 2, 2026 09:01
@Thearas
Copy link
Contributor

Thearas commented Feb 2, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@xylaaaaa
Copy link
Contributor Author

xylaaaaa commented Feb 2, 2026

run buildall

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 glog from 0.6.0 to 0.7.1 and introduce thirdparty/patches/glog-0.7.1.patch to reapply Doris-specific features (log split by size/day/hour, log file count quotas including warn-level quotas, and a DumpStackTraceToString helper).
  • Adjust third-party build and download scripts to handle glog-0.7.1 and add GLOG_USE_GLOG_EXPORT to 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 glog API (FlushLogFilesUnsafe(LogSeverity)), and record the glog upgrade 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());
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
+ fprintf(stderr, "state %s fail\n", filepath.c_str());
+ fprintf(stderr, "stat %s fail\n", filepath.c_str());

Copilot uses AI. Check for mistakes.
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"
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
GLOG_MD5SUM="128e2995cc33d794ff24f785a3060346"
GLOG_MD5SUM=""
GLOG_SHA256SUM="REPLACE_WITH_ACTUAL_PINNED_SHA256_FOR_glog-v0.7.1.tar.gz"

Copilot uses AI. Check for mistakes.
@doris-robot
Copy link

TPC-H: Total hot run time: 32197 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 72d4faaf8197e9c5aa7f95ac90134ae8c99c70bb, data reload: false

------ Round 1 ----------------------------------
q1	17634	5334	5061	5061
q2	2069	323	237	237
q3	10139	1363	753	753
q4	10204	848	312	312
q5	7498	2164	1902	1902
q6	197	182	155	155
q7	882	726	606	606
q8	9261	1388	1133	1133
q9	5089	4797	4926	4797
q10	6793	1965	1589	1589
q11	537	304	284	284
q12	337	381	227	227
q13	17758	4024	3200	3200
q14	234	238	215	215
q15	868	826	807	807
q16	668	677	603	603
q17	645	848	449	449
q18	6770	6482	7454	6482
q19	1328	1041	640	640
q20	421	359	240	240
q21	2918	2275	2225	2225
q22	375	311	280	280
Total cold run time: 102625 ms
Total hot run time: 32197 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5646	5550	5645	5550
q2	277	372	251	251
q3	2328	2831	2577	2577
q4	1519	1841	1422	1422
q5	4623	4493	4662	4493
q6	225	179	144	144
q7	2004	1926	1888	1888
q8	2529	2394	2446	2394
q9	7558	7517	7468	7468
q10	2773	3053	2675	2675
q11	559	461	461	461
q12	726	795	655	655
q13	3881	4088	3232	3232
q14	263	290	284	284
q15	834	801	796	796
q16	642	698	630	630
q17	1080	1275	1357	1275
q18	7670	7242	7509	7242
q19	867	802	789	789
q20	1979	2041	1868	1868
q21	4493	4199	4060	4060
q22	568	530	517	517
Total cold run time: 53044 ms
Total hot run time: 50671 ms

@xylaaaaa xylaaaaa closed this Feb 2, 2026
@xylaaaaa xylaaaaa reopened this Feb 2, 2026
@xylaaaaa xylaaaaa marked this pull request as draft February 2, 2026 09:45
@doris-robot
Copy link

ClickBench: Total hot run time: 28.28 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 72d4faaf8197e9c5aa7f95ac90134ae8c99c70bb, data reload: false

query1	0.05	0.05	0.05
query2	0.10	0.04	0.04
query3	0.25	0.08	0.08
query4	1.60	0.11	0.11
query5	0.27	0.27	0.25
query6	1.15	0.68	0.68
query7	0.04	0.03	0.02
query8	0.06	0.05	0.05
query9	0.57	0.51	0.50
query10	0.55	0.54	0.54
query11	0.14	0.09	0.10
query12	0.14	0.10	0.11
query13	0.64	0.61	0.62
query14	1.06	1.07	1.06
query15	0.88	0.86	0.88
query16	0.38	0.39	0.39
query17	1.09	1.14	1.13
query18	0.23	0.21	0.21
query19	1.99	2.00	2.02
query20	0.02	0.02	0.01
query21	15.47	0.24	0.14
query22	5.37	0.06	0.05
query23	16.09	0.27	0.11
query24	1.45	0.60	0.22
query25	0.10	0.06	0.11
query26	0.14	0.12	0.13
query27	0.06	0.06	0.08
query28	4.13	1.14	0.97
query29	12.58	3.93	3.15
query30	0.27	0.13	0.14
query31	2.81	0.64	0.41
query32	3.23	0.60	0.51
query33	3.19	3.23	3.22
query34	16.53	5.37	4.73
query35	4.82	4.79	4.75
query36	0.65	0.51	0.49
query37	0.11	0.07	0.07
query38	0.08	0.04	0.04
query39	0.04	0.03	0.03
query40	0.19	0.17	0.15
query41	0.09	0.04	0.03
query42	0.04	0.04	0.03
query43	0.05	0.04	0.03
Total cold run time: 98.7 s
Total hot run time: 28.28 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.53% (19351/36838)
Line Coverage 36.00% (179693/499172)
Region Coverage 32.38% (139380/430462)
Branch Coverage 33.35% (60303/180838)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.59% (25847/36103)
Line Coverage 54.21% (269961/497974)
Region Coverage 51.84% (225434/434855)
Branch Coverage 53.19% (96573/181564)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants