Skip to content

Commit 252e14f

Browse files
committed
Merge branch 'master' into develop
2 parents aa6a134 + a8096d1 commit 252e14f

File tree

406 files changed

+7137
-2612
lines changed

Some content is hidden

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

406 files changed

+7137
-2612
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ tools/rpm/systemd/profile/oceanbase-service.sh
293293
tools/rpm/systemd/profile/post_install.sh
294294
tools/rpm/systemd/profile/pre_uninstall.sh
295295
tools/rpm/systemd/profile/post_uninstall.sh
296+
tools/rpm/systemd/profile/telemetry.sh
296297

297298
############# unittest #############
298299
unittest/**/test_*

.secignore

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
https://github.com/lz4/lz4
196196
https://www.contributor-covenant.org/*
197197
https://github.com/oceanbase/*
198+
https://openwebapi.oceanbase.com*
198199
**/Doxyfile
199200
www.doxygen.org)
200201
https://www.gnu.org/software/libiconv/

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ include(cmake/Env.cmake)
55

66
if(OB_BUILD_OPENSOURCE)
77
project("OceanBase_CE"
8-
VERSION 4.3.0.0
8+
VERSION 4.3.0.1
99
DESCRIPTION "OceanBase distributed database system"
1010
HOMEPAGE_URL "https://open.oceanbase.com/"
1111
LANGUAGES CXX C ASM)
1212
message(STATUS "open source build enabled")
1313
else()
1414
project(OceanBase
15-
VERSION 4.3.0.0
15+
VERSION 4.3.0.1
1616
DESCRIPTION "OceanBase distributed database system"
1717
HOMEPAGE_URL "https://www.oceanbase.com/"
1818
LANGUAGES CXX C ASM)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The development guide is located under the [docs](docs/README.md) folder.
22

3-
# Contribution Guidelines
3+
# Contribution Guidelines
44

55
Welcome to [oceanbase]! We're thrilled that you'd like to contribute. Your help is essential for making it better.
66

cmake/RPM.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ if (OB_BUILD_OPENSOURCE)
6767
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh.template
6868
${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/oceanbase-service.sh
6969
@ONLY)
70+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh.template
71+
${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/telemetry.sh
72+
@ONLY)
7073

7174
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh.template
7275
${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh
@@ -140,6 +143,7 @@ install(FILES
140143
tools/rpm/systemd/profile/post_install.sh
141144
tools/rpm/systemd/profile/post_uninstall.sh
142145
tools/rpm/systemd/profile/pre_uninstall.sh
146+
tools/rpm/systemd/profile/telemetry.sh
143147
DESTINATION profile
144148
COMPONENT server)
145149
endif()
@@ -174,13 +178,15 @@ if(OB_BUILD_OPENSOURCE)
174178
install(
175179
FILES
176180
${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf
181+
${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml
177182
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}
178183
COMPONENT cdc
179184
)
180185
else()
181186
install(
182187
FILES
183188
${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/libobcdc.conf
189+
${PROJECT_SOURCE_DIR}/tools/upgrade/obcdc_compatiable_ob_info.yaml
184190
${PROJECT_SOURCE_DIR}/src/logservice/libobcdc/tests/timezone_info.conf
185191
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}
186192
COMPONENT cdc

deps/init/oceanbase.el7.aarch64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ obdevtools-llvm-11.0.1-312022092921.el7.aarch64.rpm
4343
[tools-deps]
4444
devdeps-oblogmsg-1.0-52022113019.el7.aarch64.rpm
4545
devdeps-rocksdb-6.22.1.1-52022100420.el7.aarch64.rpm
46-
obshell-4.2.2.0-102024011512.el7.aarch64.rpm target=community
46+
obshell-4.2.2.0-112024013121.el7.aarch64.rpm target=community
4747

4848
[test-utils]
4949
ob-deploy-2.3.0-4.el7.aarch64.rpm target=community

deps/init/oceanbase.el7.x86_64.deps

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ obdevtools-llvm-11.0.1-312022092921.el7.x86_64.rpm
4646
[tools-deps]
4747
devdeps-oblogmsg-1.0-52022113019.el7.x86_64.rpm
4848
devdeps-rocksdb-6.22.1.1-52022100420.el7.x86_64.rpm
49-
obshell-4.2.2.0-102024011512.el7.x86_64.rpm target=community
49+
obshell-4.2.2.0-112024013121.el7.x86_64.rpm target=community
5050

5151
[test-utils]
5252
ob-deploy-2.3.0-4.el7.x86_64.rpm target=community
5353
obclient-2.2.2-1.el7.x86_64.rpm target=community
5454
libobclient-2.2.2-3.el7.x86_64.rpm target=community
55-
obshell-4.2.2.0-32024010810.el7.x86_64.rpm target=community

deps/init/oceanbase.el8.aarch64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ obdevtools-llvm-11.0.1-312022092921.el8.aarch64.rpm
4343
[tools-deps]
4444
devdeps-oblogmsg-1.0-52022113019.el8.aarch64.rpm
4545
devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm
46-
obshell-4.2.2.0-102024011512.el8.aarch64.rpm target=community
46+
obshell-4.2.2.0-112024013121.el8.aarch64.rpm target=community
4747

4848
[test-utils]
4949
ob-deploy-2.3.0-4.el8.aarch64.rpm target=community

deps/init/oceanbase.el8.x86_64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ obdevtools-llvm-11.0.1-312022092921.el8.x86_64.rpm
4545
[tools-deps]
4646
devdeps-oblogmsg-1.0-52022113019.el8.x86_64.rpm
4747
devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm
48-
obshell-4.2.2.0-102024011512.el8.x86_64.rpm target=community
48+
obshell-4.2.2.0-112024013121.el8.x86_64.rpm target=community
4949

5050
[test-utils]
5151
ob-deploy-2.3.0-4.el8.x86_64.rpm target=community

deps/oblib/src/common/object/ob_obj_compare.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ OB_INLINE bool ObObjCmpFuncs::can_cmp_without_cast(const ObObjMeta& meta1,
355355
need_no_cast = false;
356356
} else if (OB_UNLIKELY(ob_is_string_type(type1)
357357
&& ob_is_string_type(type2)
358-
&& ((meta1.get_collation_type() != meta2.get_collation_type())
359-
|| tc1 != tc2))) { // string tc and text tc cannot compare directly
358+
&& ((meta1.get_collation_type() != meta2.get_collation_type())))) {
360359
need_no_cast = false;
361360
} else if (OB_FAIL(get_cmp_func(tc1, tc2, cmp_op, cmp_func))) {
362361
COMMON_LOG(ERROR, "get cmp func failed", K(type1), K(type2), K(tc1), K(tc2), K(cmp_op));

deps/oblib/src/lib/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ ob_set_subtarget(oblib_lib signal
232232
signal/ob_signal_struct.cpp
233233
signal/ob_signal_utils.cpp
234234
signal/ob_signal_worker.cpp
235-
signal/safe_snprintf.c
236235
signal/ob_libunwind.c
237236
)
238237

deps/oblib/src/lib/alloc/alloc_failed_reason.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ struct AllocFailedCtx
5353
int64_t server_limit_;
5454
};
5555
};
56-
bool need_wash() const
56+
bool need_wash_block() const
5757
{
5858
return reason_ == lib::CTX_HOLD_REACH_LIMIT ||
59-
reason_ == lib::TENANT_HOLD_REACH_LIMIT ||
60-
reason_ == lib::SERVER_HOLD_REACH_LIMIT;
59+
reason_ == lib::TENANT_HOLD_REACH_LIMIT ||
60+
reason_ == lib::SERVER_HOLD_REACH_LIMIT;
61+
}
62+
bool need_wash_chunk() const
63+
{
64+
return reason_ == lib::PHYSICAL_MEMORY_EXHAUST;
65+
6166
}
6267
};
6368

deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.cpp

+24-8
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,18 @@ void* ObTenantCtxAllocator::common_alloc(const int64_t size, const ObMemAttr &at
430430
sample_allowed = ObMallocSampleLimiter::malloc_sample_allowed(size, attr);
431431
alloc_size = sample_allowed ? (size + AOBJECT_BACKTRACE_SIZE) : size;
432432
obj = allocator.alloc_object(alloc_size, attr);
433-
if (OB_ISNULL(obj) && g_alloc_failed_ctx().need_wash()) {
434-
int64_t total_size = ta.sync_wash();
435-
ObMallocTimeMonitor::click("SYNC_WASH_END");
436-
obj = allocator.alloc_object(alloc_size, attr);
433+
if (OB_ISNULL(obj)) {
434+
int64_t total_size = 0;
435+
if (g_alloc_failed_ctx().need_wash_block()) {
436+
total_size += ta.sync_wash();
437+
ObMallocTimeMonitor::click("WASH_BLOCK_END");
438+
} else if (g_alloc_failed_ctx().need_wash_chunk()) {
439+
total_size += CHUNK_MGR.sync_wash();
440+
ObMallocTimeMonitor::click("WASH_CHUNK_END");
441+
}
442+
if (total_size > 0) {
443+
obj = allocator.alloc_object(alloc_size, attr);
444+
}
437445
}
438446
}
439447

@@ -504,10 +512,18 @@ void* ObTenantCtxAllocator::common_realloc(const void *ptr, const int64_t size,
504512
sample_allowed = ObMallocSampleLimiter::malloc_sample_allowed(size, attr);
505513
alloc_size = sample_allowed ? (size + AOBJECT_BACKTRACE_SIZE) : size;
506514
obj = allocator.realloc_object(obj, alloc_size, attr);
507-
if(OB_ISNULL(obj) && g_alloc_failed_ctx().need_wash()) {
508-
int64_t total_size = ta.sync_wash();
509-
ObMallocTimeMonitor::click("SYNC_WASH_END");
510-
obj = allocator.realloc_object(obj, alloc_size, attr);
515+
if(OB_ISNULL(obj)) {
516+
int64_t total_size = 0;
517+
if (g_alloc_failed_ctx().need_wash_block()) {
518+
total_size += ta.sync_wash();
519+
ObMallocTimeMonitor::click("WASH_BLOCK_END");
520+
} else if (g_alloc_failed_ctx().need_wash_chunk()) {
521+
total_size += CHUNK_MGR.sync_wash();
522+
ObMallocTimeMonitor::click("WASH_CHUNK_END");
523+
}
524+
if (total_size > 0) {
525+
obj = allocator.realloc_object(obj, alloc_size, attr);
526+
}
511527
}
512528
}
513529

deps/oblib/src/lib/json_type/ob_json_bin.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -3862,9 +3862,15 @@ int ObJsonBin::rebuild_json_value(const char *data,
38623862
}
38633863
case ObJsonNodeType::J_DECIMAL:
38643864
case ObJsonNodeType::J_ODECIMAL: {
3865-
int64_t pos = 0;
3865+
ObPrecision prec = -1;
3866+
ObScale scale = -1;
38663867
number::ObNumber temp_number;
3867-
if (OB_FAIL(temp_number.deserialize(data, length, pos))) {
3868+
int64_t pos = 0;
3869+
if (OB_FAIL(serialization::decode_i16(data, length, pos, &prec))) {
3870+
LOG_WARN("fail to deserialize decimal precision.", K(ret), K(length));
3871+
} else if (OB_FAIL(serialization::decode_i16(data, length, pos, &scale))) {
3872+
LOG_WARN("fail to deserialize decimal scale.", K(ret), K(length), K(prec));
3873+
} else if (OB_FAIL(temp_number.deserialize(data, length, pos))) {
38683874
LOG_WARN("failed to deserialize decimal data", K(ret));
38693875
} else {
38703876
ret = result.append(data, pos);

deps/oblib/src/lib/ob_errno.h

+2
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ constexpr int OB_BACKUP_IO_PROHIBITED = -9063;
392392
constexpr int OB_BACKUP_PERMISSION_DENIED = -9071;
393393
constexpr int OB_ESI_OBS_ERROR = -9073;
394394
constexpr int OB_BACKUP_META_INDEX_NOT_EXIST = -9076;
395+
constexpr int OB_BACKUP_FORMAT_FILE_NOT_EXIST = -9080;
396+
constexpr int OB_BACKUP_FORMAT_FILE_NOT_MATCH = -9081;
395397
constexpr int OB_BACKUP_DEVICE_OUT_OF_SPACE = -9082;
396398
constexpr int OB_BACKUP_PWRITE_OFFSET_NOT_MATCH = -9083;
397399
constexpr int OB_BACKUP_PWRITE_CONTENT_NOT_MATCH = -9084;

deps/oblib/src/lib/resource/achunk_mgr.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -437,3 +437,27 @@ int AChunkMgr::madvise(void *addr, size_t length, int advice)
437437
{
438438
return ::madvise(addr, length, advice);
439439
}
440+
441+
int64_t AChunkMgr::sync_wash()
442+
{
443+
int64_t washed_size = 0;
444+
AChunk *free_lists[2] = {};
445+
free_lists[0] = free_list_.popall();
446+
free_lists[1] = large_free_list_.popall();
447+
for (int i = 0; i < ARRAYSIZEOF(free_lists); ++i) {
448+
AChunk *head = free_lists[i];
449+
if (OB_NOT_NULL(head)) {
450+
AChunk *chunk = head;
451+
do {
452+
const int64_t hold_size = chunk->hold();
453+
const int64_t all_size = chunk->aligned();
454+
AChunk *next_chunk = chunk->next_;
455+
direct_free(chunk, all_size);
456+
IGNORE_RETURN update_hold(-hold_size, false);
457+
washed_size += hold_size;
458+
chunk = next_chunk;
459+
} while (chunk != head);
460+
}
461+
}
462+
return washed_size;
463+
}

deps/oblib/src/lib/resource/achunk_mgr.h

+20
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,24 @@ class AChunkList
117117
}
118118
return chunk;
119119
}
120+
inline AChunk *popall()
121+
{
122+
AChunk *chunk = NULL;
123+
if (!OB_ISNULL(header_)) {
124+
ObDisableDiagnoseGuard disable_diagnose_guard;
125+
if (with_mutex_) {
126+
mutex_.lock();
127+
}
128+
DEFER(if (with_mutex_) {mutex_.unlock();});
129+
if (!OB_ISNULL(header_)) {
130+
chunk = header_;
131+
hold_ = 0;
132+
pops_ = pushes_;
133+
header_ = NULL;
134+
}
135+
}
136+
return chunk;
137+
}
120138

121139
inline int64_t count() const
122140
{
@@ -222,6 +240,8 @@ class AChunkMgr
222240
inline int64_t get_huge_unmaps() { return huge_unmaps_; }
223241
inline int64_t get_shadow_hold() const { return ATOMIC_LOAD(&shadow_hold_); }
224242

243+
int64_t sync_wash();
244+
225245
private:
226246
typedef ABitSet ChunkBitMap;
227247

deps/oblib/src/lib/signal/ob_libunwind.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#ifdef __x86_64__
1414
#include "lib/signal/ob_libunwind.h"
15-
#include "lib/signal/safe_snprintf.h"
1615
#define UNW_LOCAL_ONLY
1716
#include <libunwind.h>
17+
#include "util/easy_string.h"
1818

1919
static const int MAX_BT_ADDRESS_CNT = 100;
2020
static int safe_backtrace_(unw_context_t *context, char *buf, int64_t len, int64_t *pos);
@@ -48,7 +48,7 @@ static int safe_backtrace_(unw_context_t *context, char *buf, int64_t len,
4848
} else {
4949
for (int i = 0; i < n; i++) {
5050
int64_t addr = get_rel_offset_c(addrs[i]);
51-
int count = safe_snprintf(buf + *pos, len - *pos, "0x%lx", addr);
51+
int count = lnprintf(buf + *pos, len - *pos, "0x%lx", addr);
5252
count++; // for space
5353
if (count > 0 && *pos + count < len) {
5454
*pos += count;

0 commit comments

Comments
 (0)