Skip to content

Commit 07297e4

Browse files
committed
Merge branch 'master' into develop
2 parents e7a6032 + 1777b2d commit 07297e4

File tree

568 files changed

+282289
-337096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

568 files changed

+282289
-337096
lines changed

build.sh

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function parse_args
6969
then
7070
CPP_STANDARD_OPTION=20
7171
CPP_STANDARD_20_OPTION=ON
72+
elif [[ "$i" == "-DBUILD_CDC_ONLY=ON" ]]
73+
then
74+
ENABLE_BOLT_OPTION=OFF
75+
BUILD_ARGS+=("$i")
7276
elif [[ $NEED_MAKE == false ]]
7377
then
7478
BUILD_ARGS+=("$i")

cmake/Env.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ob_define(DEP_3RD_DIR "${CMAKE_SOURCE_DIR}/deps/3rd")
77
ob_define(DEVTOOLS_DIR "${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase/devtools")
88
ob_define(DEP_DIR "${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase/deps/devel")
99

10-
ob_define(OB_BUILD_CDC OFF)
10+
ob_define(BUILD_CDC_ONLY OFF)
1111
ob_define(OB_USE_CLANG ON)
1212
ob_define(OB_ERRSIM OFF)
1313
ob_define(BUILD_NUMBER 1)
@@ -207,7 +207,7 @@ if(OB_BUILD_CPP_ODPS)
207207
endif()
208208

209209
# should not use initial-exec for tls-model if building OBCDC.
210-
if(OB_BUILD_CDC)
210+
if(BUILD_CDC_ONLY)
211211
add_definitions(-DOB_BUILD_CDC_DISABLE_VSAG)
212212
else()
213213
add_definitions(-DENABLE_INITIAL_EXEC_TLS_MODEL)
@@ -264,11 +264,11 @@ if (OB_USE_CLANG)
264264
set(_CMAKE_TOOLCHAIN_LOCATION "${DEVTOOLS_DIR}/bin")
265265

266266
if (OB_USE_ASAN)
267-
ob_define(CMAKE_ASAN_FLAG "-fstack-protector-strong -fsanitize=address -fno-optimize-sibling-calls -fsanitize-blacklist=${ASAN_IGNORE_LIST}")
267+
ob_define(CMAKE_ASAN_FLAG "-mllvm -asan-stack=0 -fsanitize=address -fno-optimize-sibling-calls -fsanitize-blacklist=${ASAN_IGNORE_LIST}")
268268
endif()
269269

270270
if (OB_USE_LLD)
271-
set(LD_OPT "-fuse-ld=${DEVTOOLS_DIR}/bin/ld.lld")
271+
set(LD_OPT "-fuse-ld=${DEVTOOLS_DIR}/bin/ld.lld -Wno-unused-command-line-argument")
272272
set(REORDER_COMP_OPT "-ffunction-sections -fdebug-info-for-profiling")
273273
set(REORDER_LINK_OPT "-Wl,--no-rosegment,--build-id=sha1 ${HOTFUNC_OPT}")
274274
set(OB_LD_BIN "${DEVTOOLS_DIR}/bin/ld.lld")

cmake/Pack.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ install(FILES
8888
endif()
8989

9090
## oceanbase-cdc
91-
if (NOT OB_SO_CACHE AND OB_BUILD_CDC)
91+
if (NOT OB_SO_CACHE AND BUILD_CDC_ONLY)
9292
list(APPEND CPACK_COMPONENTS_ALL cdc)
9393
include(GNUInstallDirs)
9494
install(

cmake/RPM.cmake

+22-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ set(CPACK_GENERATOR "RPM")
33
set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
44
set(CPACK_RPM_COMPONENT_INSTALL ON)
55
# use "server" as main component so its RPM filename won't have "server"
6-
set(CPACK_RPM_MAIN_COMPONENT "server")
6+
if (BUILD_CDC_ONLY)
7+
set(CPACK_RPM_MAIN_COMPONENT "cdc")
8+
else()
9+
set(CPACK_RPM_MAIN_COMPONENT "server")
10+
endif()
711
# let rpmbuild determine rpm filename
812
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
13+
set(CMAKE_INSTALL_LIBDIR "lib64")
914
## Stardard debuginfo generating instructions in cmake. However 6u
1015
## server with rpm-4.8.0 which doesn't support dwarf4 won't generate
1116
## BUILDID for RPM. And Our debuginfo package doesn't contain source
@@ -40,7 +45,7 @@ set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
4045
set(CPACK_RPM_PACKAGE_LICENSE "Mulan PubL v2.")
4146
set(CPACK_RPM_DEFAULT_USER "admin")
4247
set(CPACK_RPM_DEFAULT_GROUP "admin")
43-
if (OB_BUILD_OPENSOURCE)
48+
if (OB_BUILD_OPENSOURCE AND NOT BUILD_CDC_ONLY)
4449
set(DEBUG_INSTALL_POST "mv $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell %{_builddir}/obshell; %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir}; mv %{_builddir}/obshell $RPM_BUILD_ROOT/../server/home/admin/oceanbase/bin/obshell; %{nil}")
4550
else()
4651
set(DEBUG_INSTALL_POST "%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir};%{nil}")
@@ -102,14 +107,25 @@ install(FILES
102107
COMPONENT server)
103108
endif()
104109

110+
if (BUILD_CDC_ONLY)
111+
message(STATUS "oceanbase build cdc only")
112+
set(CPACK_COMPONENTS_ALL cdc)
113+
set(CPACK_PACKAGE_NAME "oceanbase-cdc")
114+
if (OB_BUILD_OPENSOURCE)
115+
set(CPACK_PACKAGE_NAME "oceanbase-ce-cdc")
116+
endif()
117+
else()
118+
add_custom_target(bitcode_to_elf ALL
119+
DEPENDS ${BITCODE_TO_ELF_LIST})
120+
add_custom_target(ob_table ALL
121+
DEPENDS obtable obtable_static)
122+
endif()
123+
message(STATUS "Cpack Components:${CPACK_COMPONENTS_ALL}")
124+
105125
# install cpack to make everything work
106126
include(CPack)
107127

108128
#add rpm target to create RPMS
109129
add_custom_target(rpm
110130
COMMAND +make package
111-
DEPENDS
112-
observer obcdc_tailf obtable obtable_static
113-
ob_admin ob_error ob_sql_proxy_parser_static
114-
${BITCODE_TO_ELF_LIST}
115131
)

deps/init/oceanbase.al8.aarch64.deps

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ devdeps-zlib-static-1.2.13-82024102414.al8.aarch64.rpm
2727
devdeps-ncurses-static-6.2-112024092810.al8.aarch64.rpm
2828
devdeps-boost-1.74.0-72024092811.al8.aarch64.rpm
2929
devdeps-s2geometry-0.9.0-112024100811.al8.aarch64.rpm
30-
devdeps-icu-69.1-192024092811.al8.aarch64.rpm
30+
devdeps-icu-69.1-232024120517.al8.aarch64.rpm
3131
devdeps-cos-c-sdk-5.0.21-282024102810.al8.aarch64.rpm
3232
devdeps-s3-cpp-sdk-1.11.156-222024100811.al8.aarch64.rpm
3333
devdeps-protobuf-c-1.4.1-100000132024092815.al8.aarch64.rpm
@@ -51,7 +51,7 @@ obdevtools-llvm-17.0.3-232024111415.al8.aarch64.rpm cpp_standard=20
5151
devdeps-oblogmsg-1.1-122024093010.al8.aarch64.rpm
5252
obdevtools-obstack-2.0.4-42024101017.al8.aarch64.rpm
5353
devdeps-rocksdb-6.22.1.1-172024092818.al8.aarch64.rpm
54-
obshell-4.2.4.2-12024102115.al8.aarch64.rpm target=community
54+
obshell-4.2.5.0-12024121011.al8.aarch64.rpm target=community
5555

5656
[test-utils]
5757
ob-deploy-2.10.0-4.al8.aarch64.rpm target=community

deps/init/oceanbase.al8.x86_64.deps

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ devdeps-zlib-static-1.2.13-82024102414.al8.x86_64.rpm
2828
devdeps-ncurses-static-6.2-112024092810.al8.x86_64.rpm
2929
devdeps-boost-1.74.0-72024092811.al8.x86_64.rpm
3030
devdeps-s2geometry-0.9.0-112024100811.al8.x86_64.rpm
31-
devdeps-icu-69.1-192024092811.al8.x86_64.rpm
31+
devdeps-icu-69.1-232024120517.al8.x86_64.rpm
3232
devdeps-cloud-qpl-1.1.0-312024092814.al8.x86_64.rpm
3333
devdeps-cos-c-sdk-5.0.21-282024102810.al8.x86_64.rpm
3434
devdeps-s3-cpp-sdk-1.11.156-222024100811.al8.x86_64.rpm
@@ -54,7 +54,7 @@ obdevtools-llvm-17.0.3-232024111415.el8.x86_64.rpm cpp_standard=20
5454
devdeps-oblogmsg-1.1-122024093010.al8.x86_64.rpm
5555
devdeps-rocksdb-6.22.1.1-172024092818.al8.x86_64.rpm
5656
obdevtools-obstack-2.0.4-42024101017.al8.x86_64.rpm
57-
obshell-4.2.4.2-12024102115.al8.x86_64.rpm target=community
57+
obshell-4.2.5.0-12024121011.al8.x86_64.rpm target=community
5858

5959
[test-utils]
6060
ob-deploy-2.10.0-4.al8.x86_64.rpm target=community

deps/init/oceanbase.el7.aarch64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ obdevtools-llvm-17.0.3-232024111415.el7.aarch64.rpm cpp_standard=20
5151
devdeps-oblogmsg-1.1-52024052811.el7.aarch64.rpm
5252
devdeps-rocksdb-6.22.1.1-52022100420.el7.aarch64.rpm
5353
obstack-2.0.4-172024070513.el7.aarch64.rpm
54-
obshell-4.2.4.3-12024110711.el7.aarch64.rpm target=community
54+
obshell-4.2.5.0-12024121011.el7.aarch64.rpm target=community
5555

5656
[test-utils]
5757
ob-deploy-2.10.0-3.el7.aarch64.rpm target=community

deps/init/oceanbase.el7.x86_64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ obdevtools-llvm-17.0.3-232024111415.el7.x86_64.rpm cpp_standard=20
5555
devdeps-oblogmsg-1.1-52024052811.el7.x86_64.rpm
5656
devdeps-rocksdb-6.22.1.1-52022100420.el7.x86_64.rpm
5757
obstack-2.0.4-172024070513.el7.x86_64.rpm
58-
obshell-4.2.4.3-12024110711.el7.x86_64.rpm target=community
58+
obshell-4.2.5.0-12024121011.el7.x86_64.rpm target=community
5959

6060
[test-utils]
6161
ob-deploy-2.10.0-3.el7.x86_64.rpm target=community

deps/init/oceanbase.el8.aarch64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ obdevtools-llvm-17.0.3-232024111415.el8.aarch64.rpm cpp_standard=20
5151
devdeps-oblogmsg-1.1-52024052811.el8.aarch64.rpm
5252
devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm
5353
obstack-2.0.4-172024070513.el8.aarch64.rpm
54-
obshell-4.2.4.3-12024110711.el8.aarch64.rpm target=community
54+
obshell-4.2.5.0-12024121011.el8.aarch64.rpm target=community
5555

5656
[test-utils]
5757
ob-deploy-2.10.0-3.el8.aarch64.rpm target=community

deps/init/oceanbase.el8.x86_64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ obdevtools-llvm-17.0.3-232024111415.el8.x86_64.rpm cpp_standard=20
5454
devdeps-oblogmsg-1.1-52024052811.el8.x86_64.rpm
5555
devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm
5656
obstack-2.0.4-172024070513.el8.x86_64.rpm
57-
obshell-4.2.4.3-12024110711.el8.x86_64.rpm target=community
57+
obshell-4.2.5.0-12024121011.el8.x86_64.rpm target=community
5858

5959
[test-utils]
6060
ob-deploy-2.10.0-3.el8.x86_64.rpm target=community

deps/init/oceanbase.el9.aarch64.deps

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm
3939
devdeps-apache-arrow-9.0.0-322024052923.el8.aarch64.rpm
4040
devdeps-apache-orc-1.8.3-392024091317.el8.aarch64.rpm
4141
devdeps-vsag-1.0.0-352024102510.el8.aarch64.rpm
42+
devdeps-fast-float-6.1.3-42024112122.el8.aarch64.rpm
4243

4344
[deps-el9]
4445
devdeps-apr-1.6.5-232023090616.el9.aarch64.rpm target=el9
@@ -57,7 +58,7 @@ obdevtools-llvm-17.0.3-232024111415.el8.aarch64.rpm cpp_standard=20
5758
devdeps-oblogmsg-1.1-52024052811.el8.aarch64.rpm
5859
devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm
5960
obstack-2.0.4-172024070513.el8.aarch64.rpm
60-
obshell-4.2.4.3-12024110711.el8.aarch64.rpm target=community
61+
obshell-4.2.5.0-12024121011.el8.aarch64.rpm target=community
6162

6263
[test-utils]
6364
ob-deploy-1.6.0-41.el8.aarch64.rpm target=community

deps/init/oceanbase.el9.x86_64.deps

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm
4242
devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm
4343
devdeps-apache-orc-1.8.3-392024091317.el8.x86_64.rpm
4444
devdeps-vsag-1.0.0-352024102510.el8.x86_64.rpm
45+
devdeps-fast-float-6.1.3-42024112122.el8.x86_64.rpm
4546

4647
[deps-el9]
4748
devdeps-apr-1.6.5-232023090616.el9.x86_64.rpm target=el9
@@ -60,7 +61,7 @@ obdevtools-llvm-17.0.3-232024111415.el8.x86_64.rpm cpp_standard=20
6061
devdeps-oblogmsg-1.1-52024052811.el8.x86_64.rpm
6162
devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm
6263
obstack-2.0.4-172024070513.el8.x86_64.rpm
63-
obshell-4.2.4.3-12024110711.el8.x86_64.rpm target=community
64+
obshell-4.2.5.0-12024121011.el8.x86_64.rpm target=community
6465

6566
[test-utils]
6667
ob-deploy-1.6.0-41.el8.x86_64.rpm target=community

deps/oblib/src/common/ob_target_specific.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,31 @@
1111
*/
1212

1313
#define USING_LOG_PREFIX COMMON
14+
#include "common/ob_target_specific.h"
1415

1516
namespace oceanbase
1617
{
1718
namespace common
1819
{
1920

21+
uint32_t arches;
22+
void init_arches()
23+
{
24+
arches = 0;
25+
const CpuFlagSet flags;
26+
if (flags.have_flag(CpuFlag::SSE4_2)) {
27+
arches |= static_cast<uint32_t>(ObTargetArch::SSE42);
28+
}
29+
if (flags.have_flag(CpuFlag::AVX)) {
30+
arches |= static_cast<uint32_t>(ObTargetArch::AVX);
31+
}
32+
if (flags.have_flag(CpuFlag::AVX2)) {
33+
arches |= static_cast<uint32_t>(ObTargetArch::AVX2);
34+
}
35+
if (flags.have_flag(CpuFlag::AVX512BW)) {
36+
arches |= static_cast<uint32_t>(ObTargetArch::AVX512);
37+
}
38+
}
39+
2040
} // namespace common
2141
} // namespace oceanbase

deps/oblib/src/common/ob_target_specific.h

+2-18
Original file line numberDiff line numberDiff line change
@@ -215,27 +215,11 @@ OB_DECLARE_AVX512_SPECIFIC_CODE(
215215

216216
#endif
217217

218-
OB_INLINE uint32_t get_supported_archs()
219-
{
220-
uint32_t result = 0;
221-
if (CpuFlagSet::get_instance().have_flag(CpuFlag::SSE4_2)) {
222-
result |= static_cast<uint32_t>(ObTargetArch::SSE42);
223-
}
224-
if (CpuFlagSet::get_instance().have_flag(CpuFlag::AVX)) {
225-
result |= static_cast<uint32_t>(ObTargetArch::AVX);
226-
}
227-
if (CpuFlagSet::get_instance().have_flag(CpuFlag::AVX2)) {
228-
result |= static_cast<uint32_t>(ObTargetArch::AVX2);
229-
}
230-
if (CpuFlagSet::get_instance().have_flag(CpuFlag::AVX512BW)) {
231-
result |= static_cast<uint32_t>(ObTargetArch::AVX512);
232-
}
233-
return result;
234-
}
218+
void init_arches();
219+
extern uint32_t arches;
235220

236221
OB_INLINE bool is_arch_supported(ObTargetArch arch)
237222
{
238-
static uint32_t arches = get_supported_archs();
239223
return arch == ObTargetArch::Default || (arches & static_cast<uint32_t>(arch));
240224
}
241225

deps/oblib/src/common/storage/ob_io_device.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ class ObIODevice
491491
virtual int64_t get_max_block_size(int64_t reserved_size) const = 0;
492492
virtual int64_t get_max_block_count(int64_t reserved_size) const = 0;
493493
virtual int64_t get_reserved_block_count() const = 0;
494-
virtual int check_space_full(const int64_t required_size) const = 0;
494+
virtual int check_space_full(
495+
const int64_t required_size,
496+
const bool alarm_if_space_full = true) const = 0;
495497
virtual int check_write_limited() const = 0;
496498

497499
// ref cnt

deps/oblib/src/lib/CMakeLists.txt

+8-4
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,13 @@ add_library(ob_malloc STATIC)
423423
target_link_libraries(ob_malloc ob_malloc_object)
424424

425425
add_library(malloc_hook STATIC
426-
alloc/malloc_hook.cpp
427-
alloc/malloc_hook.h
428-
alloc/malloc_hook_extended.cpp)
426+
alloc/malloc_hook.cpp
427+
alloc/malloc_hook.h
428+
alloc/malloc_hook_extended.cpp)
429+
if (BUILD_CDC_ONLY)
430+
set_target_properties(malloc_hook PROPERTIES EXCLUDE_FROM_ALL TRUE)
431+
endif()
432+
429433
target_link_libraries(malloc_hook oblib_base)
430434

431435
if(OB_BUILD_CLOSE_MODULES)
@@ -445,7 +449,7 @@ target_link_libraries(oblib_lib
445449
${DEP_DIR}/lib/liblzma.a
446450
)
447451

448-
if (NOT OB_BUILD_CDC)
452+
if (NOT BUILD_CDC_ONLY)
449453
# vsag vector library
450454
target_link_directories(
451455
oblib_lib PUBLIC ${DEP_DIR}/lib ${DEP_DIR}/lib/vsag_lib

0 commit comments

Comments
 (0)