From f52ea67e29fb49b7c7399648a973dc142dfa5fa5 Mon Sep 17 00:00:00 2001 From: Kaleb S KEITHLEY Date: Mon, 4 Jan 2021 21:12:08 -0500 Subject: [PATCH] ceph 15.2.8 GA Signed-off-by: Kaleb S KEITHLEY --- 0004-src-common-ceph-time.h.patch | 10 ++++ 0005-src-CMakeLists.txt.patch | 21 ++++++++ 0006-src-rgw-rgw_asio_frontend.cc.patch | 64 +++++++++++++++++++++++++ ceph.spec | 5 +- 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 0004-src-common-ceph-time.h.patch create mode 100644 0005-src-CMakeLists.txt.patch create mode 100644 0006-src-rgw-rgw_asio_frontend.cc.patch diff --git a/0004-src-common-ceph-time.h.patch b/0004-src-common-ceph-time.h.patch new file mode 100644 index 0000000..c8f7661 --- /dev/null +++ b/0004-src-common-ceph-time.h.patch @@ -0,0 +1,10 @@ +--- ceph-15.2.8/src/common/ceph_time.h.orig 2020-12-24 06:23:32.605762289 -0500 ++++ ceph-15.2.8/src/common/ceph_time.h 2020-12-24 13:50:14.304877611 -0500 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + + #include "include/ceph_assert.h" diff --git a/0005-src-CMakeLists.txt.patch b/0005-src-CMakeLists.txt.patch new file mode 100644 index 0000000..00a017c --- /dev/null +++ b/0005-src-CMakeLists.txt.patch @@ -0,0 +1,21 @@ +--- ceph-15.2.8/src/CMakeLists.txt.orig 2021-01-03 12:47:00.275274985 -0500 ++++ ceph-15.2.8/src/CMakeLists.txt 2021-01-03 12:51:17.957185433 -0500 +@@ -23,10 +23,15 @@ + set(datadir ${CEPH_INSTALL_DATADIR}) + set(prefix ${CMAKE_INSTALL_PREFIX}) + +-add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS") +-add_definitions("-D_FILE_OFFSET_BITS=64") ++add_definitions(-DHAVE_CONFIG_H ++ -D__CEPH__ ++ -D_REENTRANT ++ -D_THREAD_SAFE ++ -D__STDC_FORMAT_MACROS ++ -D_FILE_OFFSET_BITS=64 ++ -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) + if(LINUX) +- add_definitions("-D_GNU_SOURCE") ++ add_definitions(-D_GNU_SOURCE) + endif() + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") diff --git a/0006-src-rgw-rgw_asio_frontend.cc.patch b/0006-src-rgw-rgw_asio_frontend.cc.patch new file mode 100644 index 0000000..de47ac6 --- /dev/null +++ b/0006-src-rgw-rgw_asio_frontend.cc.patch @@ -0,0 +1,64 @@ +--- ceph-15.2.8/src/rgw/rgw_asio_frontend.cc.orig 2020-12-16 12:29:50.000000000 -0500 ++++ ceph-15.2.8/src/rgw/rgw_asio_frontend.cc 2021-01-04 18:20:49.156104233 -0500 +@@ -2,6 +2,7 @@ + // vim: ts=8 sw=2 smarttab ft=cpp + + #include ++#include + #include + #include + +@@ -138,6 +139,29 @@ + return out << h.quote << p->value() << h.quote; + } + ++// log fractional seconds in milliseconds ++struct log_ms_remainder { ++ ceph::coarse_real_time t; ++ log_ms_remainder(ceph::coarse_real_time t) : t(t) {} ++}; ++std::ostream& operator<<(std::ostream& out, const log_ms_remainder& m) { ++ using namespace std::chrono; ++ return out << std::setfill('0') << std::setw(3) ++ << duration_cast(m.t.time_since_epoch()).count() % 1000; ++} ++ ++// log time in apache format: day/month/year:hour:minute:second zone ++struct log_apache_time { ++ ceph::coarse_real_time t; ++ log_apache_time(ceph::coarse_real_time t) : t(t) {} ++}; ++std::ostream& operator<<(std::ostream& out, const log_apache_time& a) { ++ const auto t = ceph::coarse_real_clock::to_time_t(a.t); ++ const auto local = std::localtime(&t); ++ return out << std::put_time(local, "%d/%b/%Y:%T.") << log_ms_remainder{a.t} ++ << std::put_time(local, " %z"); ++}; ++ + using SharedMutex = ceph::async::SharedMutex; + + template +@@ -228,16 +252,20 @@ + RGWRestfulIO client(cct, &real_client_io); + auto y = optional_yield{context, yield}; + int http_ret = 0; ++ string user = "-"; ++ const auto started = ceph::coarse_real_clock::now(); ++ + process_request(env.store, env.rest, &req, env.uri_prefix, + *env.auth_registry, &client, env.olog, y, + scheduler, &http_ret); + + if (cct->_conf->subsys.should_gather(dout_subsys, 1)) { + // access log line elements begin per Apache Combined Log Format with additions following +- const auto now = ceph::coarse_real_clock::now(); +- using ceph::operator<<; // for coarse_real_time ++ // const auto now = ceph::coarse_real_clock::now(); ++ // using ceph::operator<<; // for coarse_real_time + ldout(cct, 1) << "beast: " << hex << &req << dec << ": " +- << remote_endpoint.address() << " - - [" << now << "] \"" ++ // << remote_endpoint.address() << " - - [" << now << "] \"" ++ << remote_endpoint.address() << " - " << user << " [" << log_apache_time{started} << "] \"" + << message.method_string() << ' ' << message.target() << ' ' + << http_version{message.version()} << "\" " << http_ret << ' ' + << client.get_bytes_sent() + client.get_bytes_received() << ' ' diff --git a/ceph.spec b/ceph.spec index 4c0a001..c691963 100644 --- a/ceph.spec +++ b/ceph.spec @@ -121,6 +121,9 @@ Source0: %{?_remote_tarball_prefix}ceph-%{version}.tar.gz Patch0001: 0001-src-common-crc32c_intel_fast.patch Patch0002: 0002-src-common-CMakeLists.txt.patch Patch0003: 0003-src-common-bitstr.h.patch +Patch0004: 0004-src-common-ceph-time.h.patch +Patch0005: 0005-src-CMakeLists.txt.patch +Patch0006: 0006-src-rgw-rgw_asio_frontend.cc.patch Source1: cmake-modules-BuildBoost.cmake.noautopatch # ceph 14.0.1 does not support 32-bit architectures, bugs #1727788, #1727787 ExcludeArch: i686 armv7hl @@ -1278,7 +1281,7 @@ cat ./CMakeFiles/CMakeError.log export VERBOSE=1 export V=1 -%cmake_build "$CEPH_MFLAGS_JOBS" +%cmake_build %if 0%{with make_check}