Change the memory of ObEncodingRowBufHolder to hang on its own tenant which used to hang on 500.
This commit is contained in:
@ -153,7 +153,8 @@ int ObMapAttrOperator::get_ref_byte(const int8_t attr, int64_t &byte)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObEncodingRowBufHolder::init(const int64_t macro_block_size)
|
int ObEncodingRowBufHolder::init(const int64_t macro_block_size,
|
||||||
|
const int64_t tenant_id)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (is_inited_) {
|
if (is_inited_) {
|
||||||
@ -162,7 +163,11 @@ int ObEncodingRowBufHolder::init(const int64_t macro_block_size)
|
|||||||
if (OB_UNLIKELY(macro_block_size <= 0)) {
|
if (OB_UNLIKELY(macro_block_size <= 0)) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("Invalid block size", K(ret), K(macro_block_size));
|
LOG_WARN("Invalid block size", K(ret), K(macro_block_size));
|
||||||
|
} else if (!is_valid_tenant_id(tenant_id)){
|
||||||
|
ret = OB_INVALID_ARGUMENT;
|
||||||
|
LOG_WARN("invalid tenant id", K(ret), K(tenant_id));
|
||||||
} else {
|
} else {
|
||||||
|
allocator_.set_tenant_id(tenant_id);
|
||||||
buf_size_limit_ = macro_block_size * 3;
|
buf_size_limit_ = macro_block_size * 3;
|
||||||
is_inited_ = true;
|
is_inited_ = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -650,7 +650,7 @@ public:
|
|||||||
const int64_t page_size = common::OB_MALLOC_MIDDLE_BLOCK_SIZE)
|
const int64_t page_size = common::OB_MALLOC_MIDDLE_BLOCK_SIZE)
|
||||||
: allocator_(label, page_size), buf_size_limit_(0), alloc_size_(0), alloc_buf_(nullptr) {}
|
: allocator_(label, page_size), buf_size_limit_(0), alloc_size_(0), alloc_buf_(nullptr) {}
|
||||||
virtual ~ObEncodingRowBufHolder() {}
|
virtual ~ObEncodingRowBufHolder() {}
|
||||||
int init(const int64_t macro_block_size);
|
int init(const int64_t macro_block_size, const int64_t tenant_id = OB_SERVER_TENANT_ID);
|
||||||
void reset();
|
void reset();
|
||||||
// try to re-alloc held memory buffer
|
// try to re-alloc held memory buffer
|
||||||
int try_alloc(const int64_t required_size);
|
int try_alloc(const int64_t required_size);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ int ObMicroBlockEncoder::init(const ObMicroBlockEncodingCtx &ctx)
|
|||||||
LOG_WARN("reserve array failed", K(ret), "size", ctx.column_cnt_);
|
LOG_WARN("reserve array failed", K(ret), "size", ctx.column_cnt_);
|
||||||
} else if (OB_FAIL(init_all_col_values(ctx))) {
|
} else if (OB_FAIL(init_all_col_values(ctx))) {
|
||||||
LOG_WARN("init all_col_values failed", K(ret), K(ctx));
|
LOG_WARN("init all_col_values failed", K(ret), K(ctx));
|
||||||
} else if (OB_FAIL(row_buf_holder_.init(ctx.macro_block_size_))) {
|
} else if (OB_FAIL(row_buf_holder_.init(ctx.macro_block_size_, MTL_ID()))) {
|
||||||
LOG_WARN("init row buf holder failed", K(ret));
|
LOG_WARN("init row buf holder failed", K(ret));
|
||||||
} else {
|
} else {
|
||||||
// TODO bin.lb: shrink all_col_values_ size
|
// TODO bin.lb: shrink all_col_values_ size
|
||||||
|
|||||||
@ -50,11 +50,20 @@ public:
|
|||||||
virtual void TearDown();
|
virtual void TearDown();
|
||||||
|
|
||||||
TestColumnDecoder()
|
TestColumnDecoder()
|
||||||
: is_retro_(false) {}
|
: is_retro_(false), tenant_ctx_(OB_SERVER_TENANT_ID)
|
||||||
|
{
|
||||||
|
share::ObTenantEnv::set_tenant(&tenant_ctx_);
|
||||||
|
}
|
||||||
TestColumnDecoder(ObColumnHeader::Type column_encoding_type)
|
TestColumnDecoder(ObColumnHeader::Type column_encoding_type)
|
||||||
: is_retro_(false), column_encoding_type_(column_encoding_type) {}
|
: is_retro_(false), column_encoding_type_(column_encoding_type), tenant_ctx_(OB_SERVER_TENANT_ID)
|
||||||
|
{
|
||||||
|
share::ObTenantEnv::set_tenant(&tenant_ctx_);
|
||||||
|
}
|
||||||
TestColumnDecoder(bool is_retro)
|
TestColumnDecoder(bool is_retro)
|
||||||
: is_retro_(is_retro) {}
|
: is_retro_(is_retro), tenant_ctx_(OB_SERVER_TENANT_ID)
|
||||||
|
{
|
||||||
|
share::ObTenantEnv::set_tenant(&tenant_ctx_);
|
||||||
|
}
|
||||||
virtual ~TestColumnDecoder() {}
|
virtual ~TestColumnDecoder() {}
|
||||||
|
|
||||||
inline void setup_obj(ObObj& obj, int64_t column_id, int64_t seed);
|
inline void setup_obj(ObObj& obj, int64_t column_id, int64_t seed);
|
||||||
@ -103,6 +112,7 @@ protected:
|
|||||||
int64_t column_cnt_;
|
int64_t column_cnt_;
|
||||||
int64_t full_column_cnt_;
|
int64_t full_column_cnt_;
|
||||||
int64_t rowkey_cnt_;
|
int64_t rowkey_cnt_;
|
||||||
|
share::ObTenantBase tenant_ctx_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestColumnDecoder::set_column_type_default()
|
void TestColumnDecoder::set_column_type_default()
|
||||||
|
|||||||
@ -42,7 +42,10 @@ class TestIColumnEncoder : public ::testing::Test
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestIColumnEncoder(const bool is_multi_version_row = false)
|
TestIColumnEncoder(const bool is_multi_version_row = false)
|
||||||
: is_multi_version_row_(is_multi_version_row) {}
|
: is_multi_version_row_(is_multi_version_row), tenant_ctx_(OB_SERVER_TENANT_ID)
|
||||||
|
{
|
||||||
|
share::ObTenantEnv::set_tenant(&tenant_ctx_);
|
||||||
|
}
|
||||||
virtual ~TestIColumnEncoder() {}
|
virtual ~TestIColumnEncoder() {}
|
||||||
virtual void SetUp();
|
virtual void SetUp();
|
||||||
virtual void TearDown() {}
|
virtual void TearDown() {}
|
||||||
@ -57,6 +60,7 @@ protected:
|
|||||||
ObArenaAllocator allocator_;
|
ObArenaAllocator allocator_;
|
||||||
common::ObArray<share::schema::ObColDesc> col_descs_;
|
common::ObArray<share::schema::ObColDesc> col_descs_;
|
||||||
bool is_multi_version_row_;
|
bool is_multi_version_row_;
|
||||||
|
share::ObTenantBase tenant_ctx_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestIColumnEncoder::SetUp()
|
void TestIColumnEncoder::SetUp()
|
||||||
|
|||||||
@ -205,7 +205,10 @@ public:
|
|||||||
virtual void SetUp();
|
virtual void SetUp();
|
||||||
virtual void TearDown() {}
|
virtual void TearDown() {}
|
||||||
|
|
||||||
TestRawDecoder() {}
|
TestRawDecoder():tenant_ctx_(OB_SERVER_TENANT_ID)
|
||||||
|
{
|
||||||
|
share::ObTenantEnv::set_tenant(&tenant_ctx_);
|
||||||
|
}
|
||||||
virtual ~TestRawDecoder() {}
|
virtual ~TestRawDecoder() {}
|
||||||
|
|
||||||
void setup_obj(ObObj& obj, int64_t column_id, int64_t seed);
|
void setup_obj(ObObj& obj, int64_t column_id, int64_t seed);
|
||||||
@ -224,6 +227,7 @@ protected:
|
|||||||
ObTableReadInfo read_info_;
|
ObTableReadInfo read_info_;
|
||||||
int64_t full_column_cnt_;
|
int64_t full_column_cnt_;
|
||||||
ObArenaAllocator allocator_;
|
ObArenaAllocator allocator_;
|
||||||
|
share::ObTenantBase tenant_ctx_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestRawDecoder::SetUp()
|
void TestRawDecoder::SetUp()
|
||||||
|
|||||||
Reference in New Issue
Block a user