Do not report ERROR when sample rate equals 100

This commit is contained in:
ZenoWang
2024-02-06 14:49:31 +00:00
committed by ob-robot
parent 1f1d5c08ae
commit c8ef409bf3
3710 changed files with 486984 additions and 3083329 deletions

View File

@ -37,7 +37,6 @@ public:
{
tallocator_.set_tenant_memory_mgr();
tallocator_.set_limit(1000L << 20);
cs_.set_chunk_mgr(&tallocator_.get_chunk_mgr());
cs_.set_tenant_ctx_allocator(tallocator_);
}

View File

@ -341,32 +341,3 @@ TEST_F(TestChunkMgr, FreeListManyChunk)
EXPECT_EQ(2* AChunkList::DEFAULT_MAX_CHUNK_CACHE_SIZE/INTACT_ACHUNK_SIZE, free_list_.get_pushes());
EXPECT_EQ(AChunkList::DEFAULT_MAX_CHUNK_CACHE_SIZE/INTACT_ACHUNK_SIZE, free_list_.get_pops());
}
TEST_F(TestChunkMgr, sync_wash)
{
set_limit(1LL<<30);
int NORMAL_SIZE = OB_MALLOC_BIG_BLOCK_SIZE;
int LARGE_SIZE = INTACT_ACHUNK_SIZE + 100;
free_list_.set_max_chunk_cache_size(1LL<<30);
large_free_list_.set_max_chunk_cache_size(1LL<<30);
AChunk *chunks[16][2] = {};
for (int i = 0; i < 16; ++i) {
chunks[i][0] = alloc_chunk(NORMAL_SIZE);
chunks[i][1] = alloc_chunk(LARGE_SIZE);
}
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 2; ++j) {
free_chunk(chunks[i][j]);
chunks[i][j] = NULL;
}
}
int64_t hold = free_list_.hold() + large_free_list_.hold();
EXPECT_EQ(hold, hold_);
EXPECT_EQ(16, free_list_.count());
EXPECT_EQ(16, large_free_list_.count());
int64_t washed_size = sync_wash();
EXPECT_EQ(hold, washed_size);
EXPECT_EQ(0, hold_);
EXPECT_EQ(0, free_list_.count());
EXPECT_EQ(0, large_free_list_.count());
}

View File

@ -12,7 +12,6 @@
#include <gtest/gtest.h>
#include "lib/alloc/ob_malloc_allocator.h"
#include "lib/allocator/ob_malloc.h"
using namespace oceanbase::lib;
using namespace oceanbase::common;
@ -61,17 +60,6 @@ TEST(TestMallocAllocator, idle)
OB_MALLOC_BIG_BLOCK_SIZE));
}
TEST(TestMallocAllocator, ob_malloc_align)
{
void *ptr = ob_malloc_align(1, 4, "test");
ASSERT_TRUE(ptr != NULL);
ASSERT_EQ(0, (int64_t)ptr % 16);
ptr = ob_malloc_align(4096, 4, "test");
ASSERT_TRUE(ptr != NULL);
ASSERT_EQ(0, (int64_t)ptr % 4096);
}
int main(int argc, char *argv[])
{
signal(49, SIG_IGN);

View File

@ -238,10 +238,10 @@ TEST_F(TestObjectMgr, TestSubObjectMgr)
abort_unless(ptr != MAP_FAILED);
int64_t tenant_id = OB_SERVER_TENANT_ID;
int64_t ctx_id = ObCtxIds::DEFAULT_CTX_ID;
auto ta = ObMallocAllocator::get_instance()->get_tenant_ctx_allocator(
tenant_id, ctx_id);
ObjectMgr som(*ta.ref_allocator(), false, INTACT_NORMAL_AOBJECT_SIZE, 1, false, NULL);
SubObjectMgr som(false, tenant_id, ctx_id, INTACT_NORMAL_AOBJECT_SIZE, false, NULL);
ObMemAttr attr;
som.set_tenant_ctx_allocator(*ObMallocAllocator::get_instance()->get_tenant_ctx_allocator(
tenant_id, ctx_id).ref_allocator());
ObTenantResourceMgrHandle resource_handle;
ObResourceMgr::get_instance().get_tenant_resource_mgr(
tenant_id, resource_handle);

View File

@ -391,20 +391,6 @@ TEST(TestTenantAllocator, sub_ctx_id)
ASSERT_NE(OB_SUCCESS, malloc_allocator->recycle_tenant_allocator(tenant_id_1));
}
TEST(TestTenantAllocator, MERGE_RESERVE_CTX)
{
const uint64_t tenant_id = 1002;
ObMallocAllocator* malloc_allocator = ObMallocAllocator::get_instance();
ASSERT_EQ(OB_SUCCESS, malloc_allocator->create_and_add_tenant_allocator(tenant_id));
void *ptr_0 = ob_malloc(100L<<10, ObMemAttr(tenant_id, "Test", 0));
void *ptr_1 = ob_malloc(100L<<10, ObMemAttr(tenant_id, "Test", ObCtxIds::MERGE_RESERVE_CTX_ID));
malloc_allocator->sync_wash(tenant_id, 0, INT64_MAX);
AChunk *chunk_0 = AChunk::ptr2chunk(ptr_0);
AChunk *chunk_1 = AChunk::ptr2chunk(ptr_1);
ASSERT_NE(0, chunk_0->washed_size_);
ASSERT_EQ(0, chunk_1->washed_size_);
}
int main(int argc, char *argv[])
{
signal(49, SIG_IGN);