Skip to content

Commit a8d15b7

Browse files
authored
Merge branch 'master' into develop
2 parents f694949 + bf9944d commit a8d15b7

File tree

418 files changed

+10927
-4053
lines changed

Some content is hidden

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

418 files changed

+10927
-4053
lines changed

.github/workflows/compile.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
large-packages: true
3333
swap-storage: true
3434
docker-images: true
35-
35+
3636
- uses: actions/checkout@v3
3737

3838
- name: Install ubuntu environment

.github/workflows/mkbook.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
mkdir mdbook
3838
mv docs mdbook/src
39-
39+
4040
- name: Install mdBook
4141
run: |
4242
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh

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.1
8+
VERSION 4.3.1.0
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.1
15+
VERSION 4.3.1.0
1616
DESCRIPTION "OceanBase distributed database system"
1717
HOMEPAGE_URL "https://www.oceanbase.com/"
1818
LANGUAGES CXX C ASM)

cmake/DEB.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ if(DEBIAN_NAME AND DEBIAN_VERSION)
2929
endif()
3030

3131
set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
32-
set(CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}")
3332
set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
3433
set(CPACK_PACKAGE_CONTACT "${OceanBase_CE_HOMEPAGE_URL}")
3534
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "OceanBase")
@@ -38,6 +37,7 @@ set(CPACK_DEBIAN_PACKAGE_PRIORITY "Optional")
3837

3938
# systemd define on deb
4039
if (OB_BUILD_OPENSOURCE)
40+
set(CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}")
4141
set(CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS "${CPACK_DEBIAN_SERVER_PACKAGE_DEPENDS}, jq, systemd")
4242

4343
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh.template

cmake/RPM.cmake

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ else()
3131
endif()
3232

3333
set(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
34-
if (CPACK_RPM_PACKAGE_RELEASE)
35-
set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}")
36-
else()
37-
set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}")
38-
endif()
3934
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
4035
set(CPACK_RPM_PACKAGE_LICENSE "Mulan PubL v2.")
4136
set(CPACK_RPM_DEFAULT_USER "admin")
@@ -59,7 +54,7 @@ set(CPACK_RPM_SPEC_MORE_DEFINE
5954

6055
# systemd define on rpm
6156
if (OB_BUILD_OPENSOURCE)
62-
set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "${CPACK_RPM_SERVER_PACKAGE_REQUIRES}, jq, systemd")
57+
set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}, jq, systemd")
6358

6459
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh.template
6560
${CMAKE_CURRENT_SOURCE_DIR}/tools/rpm/systemd/profile/post_install.sh

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-182024030421.el7.aarch64.rpm
4545
devdeps-rocksdb-6.22.1.1-52022100420.el7.aarch64.rpm
46-
obshell-4.2.2.0-122024022614.el7.aarch64.rpm target=community
46+
obshell-4.2.3.0-102024031414.el7.aarch64.rpm target=community
4747

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

deps/init/oceanbase.el7.x86_64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ obdevtools-llvm-11.0.1-312022092921.el7.x86_64.rpm
4646
[tools-deps]
4747
devdeps-oblogmsg-1.0-182024030421.el7.x86_64.rpm
4848
devdeps-rocksdb-6.22.1.1-52022100420.el7.x86_64.rpm
49-
obshell-4.2.2.0-122024022614.el7.x86_64.rpm target=community
49+
obshell-4.2.3.0-102024031414.el7.x86_64.rpm target=community
5050

5151
[test-utils]
5252
ob-deploy-2.6.2-2.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-182024030421.el8.aarch64.rpm
4545
devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm
46-
obshell-4.2.2.0-122024022614.el8.aarch64.rpm target=community
46+
obshell-4.2.3.0-102024031414.el8.aarch64.rpm target=community
4747

4848
[test-utils]
4949
ob-deploy-2.6.2-2.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-182024030421.el8.x86_64.rpm
4747
devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm
48-
obshell-4.2.2.0-122024022614.el8.x86_64.rpm target=community
48+
obshell-4.2.3.0-102024031414.el8.x86_64.rpm target=community
4949

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

deps/init/oceanbase.el9.aarch64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ obdevtools-llvm-11.0.1-312022092921.el8.aarch64.rpm
5050
[tools-deps]
5151
devdeps-oblogmsg-1.0-182024030421.el8.aarch64.rpm
5252
devdeps-rocksdb-6.22.1.1-52022100420.el8.aarch64.rpm
53-
obshell-4.2.2.0-122024022614.el8.aarch64.rpm target=community
53+
obshell-4.2.3.0-102024031414.el8.aarch64.rpm target=community
5454

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

deps/init/oceanbase.el9.x86_64.deps

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ obdevtools-llvm-11.0.1-312022092921.el8.x86_64.rpm
5353
[tools-deps]
5454
devdeps-oblogmsg-1.0-182024030421.el8.x86_64.rpm
5555
devdeps-rocksdb-6.22.1.1-52022100420.el8.x86_64.rpm
56-
obshell-4.2.2.0-122024022614.el8.x86_64.rpm target=community
56+
obshell-4.2.3.0-102024031414.el8.x86_64.rpm target=community
5757

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

deps/oblib/src/lib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ ob_set_subtarget(ob_malloc_object_list common_alloc
319319
allocator/ob_mod_define.cpp
320320
allocator/ob_page_manager.cpp
321321
allocator/ob_slice_alloc.cpp
322+
allocator/ob_sql_mem_leak_checker.cpp
322323
allocator/ob_tc_malloc.cpp
323324
)
324325

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ using namespace common;
2424

2525
namespace lib
2626
{
27-
2827
thread_local ObMemAttr ObMallocHookAttrGuard::tl_mem_attr(OB_SERVER_TENANT_ID,
2928
"glibc_malloc",
3029
ObCtxIds::GLIBC);
3130
static int64_t g_divisive_mem_size[OB_MAX_CPU_NUM];
3231
static thread_local bool g_is_ob_mem_mgr_path = false;
3332

33+
uint32_t ObMemVersionNode::global_version = 0;
34+
__thread bool ObMemVersionNode::tl_ignore_node = true;
35+
__thread ObMemVersionNode* ObMemVersionNode::tl_node = NULL;
36+
3437
ObMallocHookAttrGuard::ObMallocHookAttrGuard(const ObMemAttr& attr)
3538
: old_attr_(tl_mem_attr)
3639
{

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

+66-24
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "lib/alloc/alloc_assist.h"
2424
#include "lib/alloc/abit_set.h"
2525
#include "lib/allocator/ob_mod_define.h"
26+
#include "lib/list/ob_dlink_node.h"
2627

2728
#ifndef NDEBUG
2829
#define MEMCHK_LEVEL 1
@@ -119,15 +120,24 @@ struct ObLabel
119120
const char *str_;
120121
};
121122

123+
struct ObMemVersionNode : public ObDLinkBase<ObMemVersionNode>
124+
{
125+
static uint32_t global_version;
126+
static __thread bool tl_ignore_node;
127+
static __thread ObMemVersionNode* tl_node;
128+
uint32_t version_ = UINT32_MAX;
129+
};
130+
122131
struct ObMemAttr
123132
{
124-
friend ObMemAttr DoNotUseMe(ObMemAttr &attr, bool expect_500);
133+
friend ObMemAttr DoNotUseMe(ObMemAttr &attr);
134+
friend ObMemAttr UseUnexpected500(ObMemAttr &attr);
135+
friend ObMemAttr IgnoreVersion(ObMemAttr &attr);
125136
uint64_t tenant_id_;
126137
ObLabel label_;
127138
uint64_t ctx_id_;
128139
uint64_t sub_ctx_id_;
129140
ObAllocPrio prio_;
130-
131141
explicit ObMemAttr(
132142
uint64_t tenant_id = common::OB_SERVER_TENANT_ID,
133143
ObLabel label = ObLabel(),
@@ -137,42 +147,73 @@ struct ObMemAttr
137147
label_(label),
138148
ctx_id_(ctx_id),
139149
sub_ctx_id_(ObSubCtxIds::MAX_SUB_CTX_ID),
140-
prio_(prio) {}
150+
prio_(prio),
151+
use_500_(false),
152+
expect_500_(true),
153+
ignore_version_(ObMemVersionNode::tl_ignore_node)
154+
{}
141155
int64_t to_string(char* buf, const int64_t buf_len) const;
142156
bool use_500() const { return use_500_; }
143157
bool expect_500() const { return expect_500_; }
158+
bool ignore_version() const { return ignore_version_; }
144159
private:
145-
bool use_500_ = false;
146-
bool expect_500_ = true;
160+
union {
161+
char padding__[4];
162+
struct {
163+
struct {
164+
uint8_t use_500_ : 1;
165+
uint8_t expect_500_ : 1;
166+
uint8_t ignore_version_ : 1;
167+
};
168+
};
169+
};
147170
};
148171

149-
inline ObMemAttr DoNotUseMe(ObMemAttr &attr, bool expect_500)
172+
inline ObMemAttr DoNotUseMe(ObMemAttr &attr)
150173
{
151174
attr.use_500_ = true;
152-
attr.expect_500_ = expect_500;
175+
attr.ignore_version_ = true;
153176
return attr;
154177
}
155178

156-
inline ObMemAttr DoNotUseMe(const ObMemAttr &&attr, const bool expect_500)
179+
inline ObMemAttr UseUnexpected500(ObMemAttr &attr)
157180
{
158-
ObMemAttr attr_cpy = attr;
159-
return DoNotUseMe(attr_cpy, expect_500);
181+
attr.use_500_ = true;
182+
attr.expect_500_ = false;
183+
attr.ignore_version_ = true;
184+
return attr;
160185
}
161186

162-
inline ObMemAttr DoNotUseMe(const ObLabel &label, const bool expect_500)
187+
inline ObMemAttr IgnoreVersion(ObMemAttr &attr)
163188
{
164-
ObMemAttr attr(OB_SERVER_TENANT_ID, label);
165-
return DoNotUseMe(attr, expect_500);
189+
attr.ignore_version_ = true;
190+
return attr;
166191
}
167192

168-
inline ObMemAttr DoNotUseMe(const ObLabel &label, const uint64_t ctx_id, const bool expect_500)
169-
{
170-
ObMemAttr attr(OB_SERVER_TENANT_ID, label, ctx_id);
171-
return DoNotUseMe(attr, expect_500);
172-
}
193+
#define ObMemAttrFriendFunc(func_name) \
194+
inline ObMemAttr func_name(const ObMemAttr &&attr) \
195+
{ \
196+
ObMemAttr attr_cpy = attr; \
197+
return func_name(attr_cpy); \
198+
} \
199+
inline ObMemAttr func_name(const ObLabel &label) \
200+
{ \
201+
ObMemAttr attr(OB_SERVER_TENANT_ID, label); \
202+
return func_name(attr); \
203+
} \
204+
inline ObMemAttr func_name(const ObLabel &label, const uint64_t ctx_id) \
205+
{ \
206+
ObMemAttr attr(OB_SERVER_TENANT_ID, label, ctx_id); \
207+
return func_name(attr); \
208+
}
209+
210+
ObMemAttrFriendFunc(DoNotUseMe);
211+
ObMemAttrFriendFunc(UseUnexpected500);
212+
ObMemAttrFriendFunc(IgnoreVersion);
173213

174-
#define SET_USE_500(args...) ::oceanbase::lib::DoNotUseMe(args, true)
175-
#define SET_USE_UNEXPECTED_500(args...) ::oceanbase::lib::DoNotUseMe(args, false)
214+
#define SET_USE_500(args...) ::oceanbase::lib::DoNotUseMe(args)
215+
#define SET_USE_UNEXPECTED_500(args...) ::oceanbase::lib::UseUnexpected500(args)
216+
#define SET_IGNORE_MEM_VERSION(args...) ::oceanbase::lib::IgnoreVersion(args)
176217

177218
struct AllocHelper
178219
{
@@ -274,16 +315,18 @@ struct AObject {
274315
uint16_t obj_offset_;
275316

276317
uint32_t alloc_bytes_;
277-
uint64_t tenant_id_;
318+
uint32_t version_;
278319
char label_[AOBJECT_LABEL_SIZE + 1];
279320

280321
// padding to ensure data_ is 16x offset
281322
union {
282-
char padding__[4];
323+
char padding__[16];
283324
struct {
284325
struct {
285326
uint8_t on_leak_check_ : 1;
286327
uint8_t on_malloc_sample_ : 1;
328+
uint8_t ignore_version_ : 1;
329+
287330
};
288331
};
289332
};
@@ -522,8 +565,7 @@ char *ABlock::data() const
522565
AObject::AObject()
523566
: MAGIC_CODE_(FREE_AOBJECT_MAGIC_CODE),
524567
nobjs_(0), nobjs_prev_(0), obj_offset_(0),
525-
alloc_bytes_(0), tenant_id_(0),
526-
on_leak_check_(false), on_malloc_sample_(false)
568+
alloc_bytes_(0), on_leak_check_(false), on_malloc_sample_(false)
527569
{
528570
}
529571

0 commit comments

Comments
 (0)