From 518c130a42ea30dc14971e37a26f22135a045eb7 Mon Sep 17 00:00:00 2001 From: stdpain Date: Thu, 11 Jul 2024 22:06:28 +0800 Subject: [PATCH] [Enhancement] upgrade some thirdparty 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 https://github.com/google/glog/pull/650 Signed-off-by: stdpain --- be/src/common/logconfig.cpp | 2 +- be/src/service/service_be/starrocks_be.cpp | 2 - be/src/util/filesystem_util.cc | 1 + be/src/util/stack_util.cpp | 23 +- build.sh | 3 - thirdparty/build-thirdparty.sh | 10 +- thirdparty/download-thirdparty.sh | 9 + thirdparty/patches/brpc-1.9.0.patch | 13 + thirdparty/patches/glog-0.7.1.patch | 334 ++++++++++++++++++ .../patches/s2geometry-0.9.0-cxx17.patch | 11 + thirdparty/vars.sh | 16 +- 11 files changed, 390 insertions(+), 34 deletions(-) create mode 100644 thirdparty/patches/brpc-1.9.0.patch create mode 100644 thirdparty/patches/glog-0.7.1.patch create mode 100644 thirdparty/patches/s2geometry-0.9.0-cxx17.patch diff --git a/be/src/common/logconfig.cpp b/be/src/common/logconfig.cpp index 477e2c41d74ea7..628f40f444fe1e 100644 --- a/be/src/common/logconfig.cpp +++ b/be/src/common/logconfig.cpp @@ -136,7 +136,7 @@ static void dontdump_unused_pages() { start_dump = true; } -static void failure_writer(const char* data, int size) { +static void failure_writer(const char* data, size_t size) { if (config::enable_core_file_size_optimization) { dontdump_unused_pages(); } diff --git a/be/src/service/service_be/starrocks_be.cpp b/be/src/service/service_be/starrocks_be.cpp index 236817d9657d8c..ca5e9e59f11e7e 100644 --- a/be/src/service/service_be/starrocks_be.cpp +++ b/be/src/service/service_be/starrocks_be.cpp @@ -217,9 +217,7 @@ void start_be(const std::vector& 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(); diff --git a/be/src/util/filesystem_util.cc b/be/src/util/filesystem_util.cc index 33e9d03a1c9ba8..51503395f3252c 100644 --- a/be/src/util/filesystem_util.cc +++ b/be/src/util/filesystem_util.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/be/src/util/stack_util.cpp b/be/src/util/stack_util.cpp index 6bb2031c4f1277..a89f64b600ffd2 100644 --- a/be/src/util/stack_util.cpp +++ b/be/src/util/stack_util.cpp @@ -22,8 +22,6 @@ #include #include -#include - #include "common/config.h" #include "gutil/strings/join.h" #include "gutil/strings/split.h" @@ -31,22 +29,21 @@ #include "runtime/current_thread.h" #include "util/time.h" -namespace google::glog_internal_namespace_ { -void DumpStackTraceToString(std::string* stacktrace); -} // namespace google::glog_internal_namespace_ +namespace google { +std::string GetStackTrace(); +} // import hidden stack trace functions from glog -namespace google { +namespace google::glog_internal_namespace_ { +enum class SymbolizeOptions { kNone = 0, kNoLineNumbers = 1 }; int GetStackTrace(void** result, int max_depth, int skip_count); -bool Symbolize(void* pc, char* out, int out_size); -} // namespace google +bool Symbolize(void* pc, char* out, unsigned long out_size, SymbolizeOptions options = SymbolizeOptions::kNone); +} // namespace google::glog_internal_namespace_ namespace starrocks { std::string get_stack_trace() { - std::string s; - google::glog_internal_namespace_::DumpStackTraceToString(&s); - return s; + return google::GetStackTrace(); } struct StackTraceTask { @@ -59,7 +56,7 @@ struct StackTraceTask { for (int i = 0; i < depth; ++i) { char line[2048]; char buf[1024]; - if (google::Symbolize(addrs[i], buf, sizeof(buf))) { + if (google::glog_internal_namespace_::Symbolize(addrs[i], buf, sizeof(buf))) { snprintf(line, 2048, " %16p %s\n", addrs[i], buf); } else { snprintf(line, 2048, " %16p (unknown)\n", addrs[i]); @@ -93,7 +90,7 @@ struct StackTraceTaskHash { void get_stack_trace_sighandler(int signum, siginfo_t* siginfo, void* ucontext) { auto task = reinterpret_cast(siginfo->si_value.sival_ptr); - task->depth = google::GetStackTrace(task->addrs, StackTraceTask::kMaxStackDepth, 2); + task->depth = google::glog_internal_namespace_::GetStackTrace(task->addrs, StackTraceTask::kMaxStackDepth, 2); task->done = true; } diff --git a/build.sh b/build.sh index 627c2ab7f8b07c..fee8d15c857534 100755 --- a/build.sh +++ b/build.sh @@ -153,7 +153,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 @@ -244,7 +243,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 ;; --with-tenann) WITH_TENANN=ON; shift ;; -h) HELP=1; shift ;; @@ -383,7 +381,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} \ -DWITH_TENANN=${WITH_TENANN} \ diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index 71b68935ceeadd..1b37fb06c6001e 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -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 -DCMAKE_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 } @@ -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" --libs="$TP_INSTALL_DIR/bin $TP_INSTALL_DIR/lib" --with-glog --with-thrift make -j$PARALLEL cp -rf output/* ${TP_INSTALL_DIR}/ if [ -f $TP_INSTALL_DIR/lib/libbrpc.a ]; then @@ -747,6 +742,7 @@ build_s2() { $CMAKE_CMD -G "${CMAKE_GENERATOR}" -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_PREFIX=$TP_INSTALL_DIR \ -DCMAKE_INCLUDE_PATH="$TP_INSTALL_DIR/include" \ -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CXX_STANDARD="17" \ -DGFLAGS_ROOT_DIR="$TP_INSTALL_DIR/include" \ -DWITH_GFLAGS=ON \ -DGLOG_ROOT_DIR="$TP_INSTALL_DIR/include" \ diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index 18e3e69303631c..c65b797b5541c0 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -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" @@ -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" @@ -314,6 +322,7 @@ if [ ! -f $PATCHED_MARK ]; then patch -p1 < $TP_PATCH_DIR/s2geometry-0.9.0.patch # replace uint64 with uint64_t to make compiler happy patch -p0 < $TP_PATCH_DIR/s2geometry-0.9.0-uint64.patch + patch -p1 < $TP_PATCH_DIR/s2geometry-0.9.0-cxx17.patch touch $PATCHED_MARK fi cd - diff --git a/thirdparty/patches/brpc-1.9.0.patch b/thirdparty/patches/brpc-1.9.0.patch new file mode 100644 index 00000000000000..9558ec50035a1b --- /dev/null +++ b/thirdparty/patches/brpc-1.9.0.patch @@ -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) \ No newline at end of file diff --git a/thirdparty/patches/glog-0.7.1.patch b/thirdparty/patches/glog-0.7.1.patch new file mode 100644 index 00000000000000..de9dfc1f8a75ba --- /dev/null +++ b/thirdparty/patches/glog-0.7.1.patch @@ -0,0 +1,334 @@ +diff --git a/src/flags.cc b/src/flags.cc +index c4c2aa4..7329c80 100644 +--- a/src/flags.cc ++++ b/src/flags.cc +@@ -137,6 +137,10 @@ GLOG_DEFINE_uint32(max_log_size, 1800, + GLOG_DEFINE_bool(stop_logging_if_full_disk, false, + "Stop attempting to log to disk if the disk is full."); + ++GLOG_DEFINE_string(log_split_method, "day", "split log by size, day, hour"); ++ ++GLOG_DEFINE_int32(log_filenum_quota, 10, "max log file num in log dir"); ++ + GLOG_DEFINE_string(log_backtrace_at, "", + "Emit a backtrace when logging at file:linenum."); + +diff --git a/src/glog/flags.h b/src/glog/flags.h +index cb542b9..31d5e6e 100644 +--- a/src/glog/flags.h ++++ b/src/glog/flags.h +@@ -182,6 +182,10 @@ DECLARE_string(logmailer); + + DECLARE_bool(symbolize_stacktrace); + ++DECLARE_int32(log_filenum_quota); ++ ++DECLARE_string(log_split_method); ++ + #pragma pop_macro("DECLARE_VARIABLE") + #pragma pop_macro("DECLARE_bool") + #pragma pop_macro("DECLARE_string") +diff --git a/src/glog/logging.h b/src/glog/logging.h +index 88d793f..8b90782 100644 +--- a/src/glog/logging.h ++++ b/src/glog/logging.h +@@ -52,6 +52,10 @@ + #include + #include + ++#ifndef GLOG_USE_GLOG_EXPORT ++#define GLOG_USE_GLOG_EXPORT ++#endif ++ + #if defined(GLOG_USE_GLOG_EXPORT) + # include "glog/export.h" + #endif +diff --git a/src/logging.cc b/src/logging.cc +index fc63995..16b2cb1 100644 +--- a/src/logging.cc ++++ b/src/logging.cc +@@ -31,6 +31,7 @@ + + #include "glog/logging.h" + ++#include + #include + #include + #include +@@ -443,6 +444,14 @@ class PrefixFormatter { + + std::unique_ptr g_prefix_formatter; + ++typedef struct filetime { ++ std::string name; ++ time_t time; ++ bool operator < (const struct filetime& o) const { ++ return o.time > time; ++ } ++}Filetime; ++ + // Encapsulates all file-system related state + class LogFileObject : public base::Logger { + public: +@@ -474,6 +483,8 @@ class LogFileObject : public base::Logger { + // acquiring lock_. + void FlushUnlocked(const std::chrono::system_clock::time_point& now); + ++ void CheckFileNumQuota(); ++ + private: + static const uint32 kRolloverAttemptFrequency = 0x20; + +@@ -496,6 +507,10 @@ class LogFileObject : public base::Logger { + // optional argument time_pid_string + // REQUIRES: lock_ is held + bool CreateLogfile(const string& time_pid_string); ++ ++ std::list file_list_; ++ bool inited_; ++ struct ::tm tm_time_; + }; + + // Encapsulate all log cleaner related states +@@ -707,7 +722,7 @@ inline void LogDestination::FlushLogFiles(int min_severity) { + // all this stuff. + std::lock_guard l{log_mutex}; + for (int i = min_severity; i < NUM_SEVERITIES; i++) { +- LogDestination* log = log_destination(static_cast(i)); ++ LogDestination* log = log_destinations_[i].get(); + if (log != nullptr) { + log->logger_->Flush(); + } +@@ -904,8 +919,12 @@ inline void LogDestination::LogToAllLogfiles( + ColoredWriteToStderr(severity, message, len); + } else { + for (int i = severity; i >= 0; --i) { +- LogDestination::MaybeLogToLogfile(static_cast(i), timestamp, +- message, len); ++ if (severity >= 1) { ++ LogDestination::MaybeLogToLogfile(static_cast(1), timestamp, message, len); ++ LogDestination::MaybeLogToLogfile(static_cast(0), timestamp, message, len); ++ } else if (severity == 0) { ++ LogDestination::MaybeLogToLogfile(static_cast(0), timestamp, message, len); ++ } else {} + } + } + } +@@ -997,7 +1016,8 @@ LogFileObject::LogFileObject(LogSeverity severity, const char* base_filename) + filename_extension_(), + severity_(severity), + rollover_attempt_(kRolloverAttemptFrequency - 1), +- start_time_(std::chrono::system_clock::now()) {} ++ start_time_(std::chrono::system_clock::now()), ++ inited_(false) {} + + LogFileObject::~LogFileObject() { + std::lock_guard l{mutex_}; +@@ -1058,14 +1078,9 @@ bool LogFileObject::CreateLogfile(const string& time_pid_string) { + } + string_filename += filename_extension_; + const char* filename = string_filename.c_str(); +- // only write to files, create if non-existant. +- int flags = O_WRONLY | O_CREAT; +- if (FLAGS_timestamp_in_logfile_name) { +- // demand that the file is unique for our timestamp (fail if it exists). +- flags = flags | O_EXCL; +- } +- FileDescriptor fd{ +- open(filename, flags, static_cast(FLAGS_logfile_mode))}; ++ int fdh = open(filename, O_WRONLY | O_CREAT /* | O_EXCL */ | O_APPEND, 0664); ++ FileDescriptor fd{fdh}; ++ + if (!fd) return false; + #ifdef HAVE_FCNTL + // Mark the file close-on-exec. We don't really care if this fails +@@ -1112,6 +1127,9 @@ bool LogFileObject::CreateLogfile(const string& time_pid_string) { + } + } + #endif ++ Filetime ft; ++ ft.name = string_filename; ++ file_list_.push_back(ft); + // We try to create a symlink called ., + // which is easier to use. (Every time we create a new logfile, + // we destroy the old symlink and create a new one, so it always +@@ -1155,6 +1173,55 @@ bool LogFileObject::CreateLogfile(const string& time_pid_string) { + return true; // Everything worked + } + ++void LogFileObject::CheckFileNumQuota() { ++ struct dirent *entry; ++ DIR *dp; ++ const vector & log_dirs = GetLoggingDirectories(); ++ if (log_dirs.size() < 1) return; ++ ++ //fprintf(stderr, "log dir: %s\n", log_dirs[0].c_str()); ++ // list file in log dir ++ ++ dp = opendir(log_dirs[0].c_str()); ++ if (dp == NULL) { ++ fprintf(stderr, "open log dir %s fail\n", log_dirs[0].c_str()); ++ return; ++ } ++ ++ file_list_.clear(); ++ while ((entry = readdir(dp)) != NULL) { ++ if (DT_DIR == entry->d_type || ++ DT_LNK == entry->d_type) { ++ continue; ++ } ++ std::string filename = std::string(entry->d_name); ++ //fprintf(stderr, "filename: %s\n", filename.c_str()); ++ if (filename.find(symlink_basename_ + '.' + LogSeverityNames[severity_]) == 0) { ++ std::string filepath = log_dirs[0] + "/" + filename; ++ struct stat fstat; ++ if (::stat(filepath.c_str(), &fstat) < 0) { ++ fprintf(stderr, "state %s fail\n", filepath.c_str()); ++ closedir(dp); ++ return; ++ } ++ //fprintf(stderr, "filepath: %s\n", filepath.c_str()); ++ Filetime file_time; ++ file_time.time = fstat.st_mtime; ++ file_time.name = filepath; ++ file_list_.push_back(file_time); ++ } ++ } ++ ++ closedir(dp); ++ file_list_.sort(); ++ ++ while (FLAGS_log_filenum_quota > 0 && file_list_.size() >= FLAGS_log_filenum_quota) { ++ // fprintf(stderr, "delete %s\n", file_list_.front().name.c_str()); ++ unlink(file_list_.front().name.c_str()); ++ file_list_.pop_front(); ++ } ++} ++ + void LogFileObject::Write( + bool force_flush, const std::chrono::system_clock::time_point& timestamp, + const char* message, size_t message_len) { +@@ -1171,16 +1238,58 @@ void LogFileObject::Write( + filename_extension_); + } + }; ++ std::time_t t = std::chrono::system_clock::to_time_t(timestamp); + + // Remove old logs + ScopedExit cleanupAtEnd{cleanupLogs}; + +- if (file_length_ >> 20U >= MaxLogSize() || PidHasChanged()) { ++ struct ::tm tm_time; ++ bool is_split = false; ++ if ("day" == FLAGS_log_split_method) { ++ localtime_r(&t, &tm_time); ++ if (tm_time.tm_year != tm_time_.tm_year ++ || tm_time.tm_mon != tm_time_.tm_mon ++ || tm_time.tm_mday != tm_time_.tm_mday) { ++ is_split = true; ++ } ++ } else if ("hour" == FLAGS_log_split_method) { ++ localtime_r(&t, &tm_time); ++ if (tm_time.tm_year != tm_time_.tm_year ++ || tm_time.tm_mon != tm_time_.tm_mon ++ || tm_time.tm_mday != tm_time_.tm_mday ++ || tm_time.tm_hour != tm_time_.tm_hour) { ++ is_split = true; ++ } ++ } else if (static_cast(file_length_ >> 20) >= MaxLogSize()) { ++ // PidHasChanged()) { ++ is_split = true; ++ } ++ ++ if (is_split) { + file_ = nullptr; + file_length_ = bytes_since_flush_ = dropped_mem_length_ = 0; + rollover_attempt_ = kRolloverAttemptFrequency - 1; + } + ++ if ((file_ == NULL) && (!inited_) && (FLAGS_log_split_method == "size")) { ++ CheckFileNumQuota(); ++ const char* filename = file_list_.back().name.c_str(); ++ int fd = open(filename, O_WRONLY | O_CREAT /* | O_EXCL */ | O_APPEND, 0664); ++ if (fd != -1) { ++#ifdef HAVE_FCNTL ++ // Mark the file close-on-exec. We don't really care if this fails ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif ++ file_.reset(fopen(filename, "a+")); ++ if (file_ == NULL) { // Man, we're screwed!, try to create new log file ++ close(fd); ++ } ++ fseek(file_.get(), 0, SEEK_END); ++ file_length_ = bytes_since_flush_ = ftell(file_.get()); ++ inited_ = true; ++ } ++ } ++ + // If there's no destination file, make one before outputting + if (file_ == nullptr) { + // Try to rollover the log file every 32 log messages. The only time +@@ -1190,21 +1299,35 @@ void LogFileObject::Write( + rollover_attempt_ = 0; + + struct ::tm tm_time; +- std::time_t t = std::chrono::system_clock::to_time_t(timestamp); + +- if (FLAGS_log_utc_time) { +- gmtime_r(&t, &tm_time); ++ if (!inited_) { ++ CheckFileNumQuota(); ++ inited_ = true; + } else { +- localtime_r(&t, &tm_time); ++ while (FLAGS_log_filenum_quota > 0 && file_list_.size() >= FLAGS_log_filenum_quota) { ++ unlink(file_list_.front().name.c_str()); ++ file_list_.pop_front(); ++ } + } ++ localtime_r(&t, &tm_time); + + // The logfile's filename will have the date/time & pid in it + ostringstream time_pid_stream; + time_pid_stream.fill('0'); +- time_pid_stream << 1900 + tm_time.tm_year << setw(2) << 1 + tm_time.tm_mon +- << setw(2) << tm_time.tm_mday << '-' << setw(2) +- << tm_time.tm_hour << setw(2) << tm_time.tm_min << setw(2) +- << tm_time.tm_sec << '.' << GetMainThreadPid(); ++ time_pid_stream << 1900 + tm_time.tm_year ++ << setw(2) << 1 + tm_time.tm_mon ++ << setw(2) << tm_time.tm_mday; ++ ++ if ("hour" == FLAGS_log_split_method) { ++ time_pid_stream << setw(2) << tm_time.tm_hour; ++ } else if ("day" != FLAGS_log_split_method) { ++ time_pid_stream << '-' ++ << setw(2) << tm_time.tm_hour ++ << setw(2) << tm_time.tm_min ++ << setw(2) << tm_time.tm_sec; ++ } ++ ++ tm_time_ = tm_time; + const string& time_pid_string = time_pid_stream.str(); + + if (base_filename_selected_) { +@@ -1238,8 +1361,8 @@ void LogFileObject::Write( + // deadlock. Simply use a name like invalid-user. + if (uidname.empty()) uidname = "invalid-user"; + +- stripped_filename = stripped_filename + '.' + hostname + '.' + uidname + +- ".log." + LogSeverityNames[severity_] + '.'; ++ stripped_filename = stripped_filename + "." + LogSeverityNames[severity_] + ".log."; ++ + // We're going to (potentially) try to put logs in several different dirs + const vector& log_dirs = GetLoggingDirectories(); + +@@ -1263,7 +1386,7 @@ void LogFileObject::Write( + } + + // Write a header message into the log file +- if (FLAGS_log_file_header) { ++ if (false) { + ostringstream file_header_stream; + file_header_stream.fill('0'); + file_header_stream << "Log file created at: " << 1900 + tm_time.tm_year \ No newline at end of file diff --git a/thirdparty/patches/s2geometry-0.9.0-cxx17.patch b/thirdparty/patches/s2geometry-0.9.0-cxx17.patch new file mode 100644 index 00000000000000..7524c3131b8ca4 --- /dev/null +++ b/thirdparty/patches/s2geometry-0.9.0-cxx17.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2024-07-12 11:56:13.164623272 +0000 ++++ b/CMakeLists.txt 2024-07-12 11:55:30.791316892 +0000 +@@ -13,7 +13,7 @@ + set(CMAKE_MACOSX_RPATH TRUE) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + # No compiler-specific extensions, i.e. -std=c++11, not -std=gnu++11. + set(CMAKE_CXX_EXTENSIONS OFF) \ No newline at end of file diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index 0553b012e7ac95..fd78a0924043c9 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -115,10 +115,10 @@ GFLAGS_SOURCE=gflags-2.2.2 GFLAGS_MD5SUM="1a865b93bacfa963201af3f75b7bd64c" # glog -GLOG_DOWNLOAD="https://github.com/google/glog/archive/v0.4.0.tar.gz" -GLOG_NAME=glog-0.4.0.tar.gz -GLOG_SOURCE=glog-0.4.0 -GLOG_MD5SUM="0daea8785e6df922d7887755c3d100d0" +GLOG_DOWNLOAD="https://github.com/google/glog/archive/v0.7.1.tar.gz" +GLOG_NAME=glog-0.7.1.tar.gz +GLOG_SOURCE=glog-0.7.1 +GLOG_MD5SUM="128e2995cc33d794ff24f785a3060346" # gtest GTEST_DOWNLOAD="https://github.com/google/googletest/archive/release-1.10.0.tar.gz" @@ -193,10 +193,10 @@ LEVELDB_SOURCE=leveldb-1.20 LEVELDB_MD5SUM="298b5bddf12c675d6345784261302252" # brpc -BRPC_DOWNLOAD="https://github.com/apache/brpc/archive/refs/tags/1.3.0.tar.gz" -BRPC_NAME=brpc-1.3.0.tar.gz -BRPC_SOURCE=brpc-1.3.0 -BRPC_MD5SUM="9470f1a77ec153e82cd8a25dc2148e47" +BRPC_DOWNLOAD="https://github.com/apache/brpc/archive/refs/tags/1.9.0.tar.gz" +BRPC_NAME=brpc-1.9.0.tar.gz +BRPC_SOURCE=brpc-1.9.0 +BRPC_MD5SUM="a2b626d96a5b017f2a6701ffa594530c" # rocksdb ROCKSDB_DOWNLOAD="https://github.com/facebook/rocksdb/archive/refs/tags/v6.22.1.zip"