add warning log when the number of sstable is at high level
This commit is contained in:
@ -4,10 +4,14 @@
|
||||
//
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <thread>
|
||||
|
||||
#define USING_LOG_PREFIX STORAGE
|
||||
#define private public
|
||||
#define protected public
|
||||
|
||||
#include "mtlenv/mock_tenant_module_env.h"
|
||||
#include "storage/compaction/ob_partition_merge_policy.h"
|
||||
#include "storage/ob_storage_struct.h"
|
||||
#include "storage/blocksstable/ob_sstable.h"
|
||||
@ -23,25 +27,18 @@ using namespace compaction;
|
||||
using namespace omt;
|
||||
using namespace share;
|
||||
|
||||
namespace unittest
|
||||
{
|
||||
|
||||
class TestParallelMinorDag : public ::testing::Test
|
||||
{
|
||||
public:
|
||||
TestParallelMinorDag() : allocator_(ObModIds::TEST), tenant_base_(500) {}
|
||||
TestParallelMinorDag()
|
||||
: tenant_id_(1), allocator_(ObModIds::TEST), tenant_base_(tenant_id_)
|
||||
{}
|
||||
virtual ~TestParallelMinorDag() {}
|
||||
int prepare_merge_result(const int64_t sstable_cnt, ObGetMergeTablesResult &result);
|
||||
|
||||
void SetUp()
|
||||
{
|
||||
ObTenantMetaMemMgr *t3m = OB_NEW(ObTenantMetaMemMgr, ObModIds::TEST, 500);
|
||||
ASSERT_EQ(OB_SUCCESS, t3m->init());
|
||||
|
||||
tenant_base_.set(t3m);
|
||||
ObTenantEnv::set_tenant(&tenant_base_);
|
||||
ASSERT_EQ(OB_SUCCESS, tenant_base_.init());
|
||||
}
|
||||
virtual void SetUp() override;
|
||||
virtual void TearDown() override;
|
||||
static void SetUpTestCase();
|
||||
static void TearDownTestCase();
|
||||
|
||||
share::SCN get_start_log_ts(const int64_t idx);
|
||||
share::SCN get_end_log_ts(const int64_t idx);
|
||||
@ -56,11 +53,40 @@ public:
|
||||
static const int64_t TEST_COLUMN_CNT = 6;
|
||||
static const int64_t MAX_SSTABLE_CNT = 64;
|
||||
|
||||
const uint64_t tenant_id_;
|
||||
common::ObArenaAllocator allocator_;
|
||||
ObTenantBase tenant_base_;
|
||||
ObSSTable fake_sstables_[MAX_SSTABLE_CNT];
|
||||
};
|
||||
|
||||
void TestParallelMinorDag::SetUpTestCase()
|
||||
{
|
||||
EXPECT_EQ(OB_SUCCESS, MockTenantModuleEnv::get_instance().init());
|
||||
}
|
||||
|
||||
void TestParallelMinorDag::TearDownTestCase()
|
||||
{
|
||||
MockTenantModuleEnv::get_instance().destroy();
|
||||
}
|
||||
|
||||
void TestParallelMinorDag::SetUp()
|
||||
{
|
||||
ObTenantMetaMemMgr *t3m = OB_NEW(ObTenantMetaMemMgr, ObModIds::TEST, tenant_id_);
|
||||
ASSERT_EQ(OB_SUCCESS, t3m->init());
|
||||
|
||||
tenant_base_.set(t3m);
|
||||
ObTenantEnv::set_tenant(&tenant_base_);
|
||||
ASSERT_EQ(OB_SUCCESS, tenant_base_.init());
|
||||
}
|
||||
|
||||
void TestParallelMinorDag::TearDown()
|
||||
{
|
||||
ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr *);
|
||||
t3m->destroy();
|
||||
ObTenantEnv::set_tenant(nullptr);
|
||||
}
|
||||
|
||||
|
||||
int TestParallelMinorDag::prepare_merge_result(
|
||||
const int64_t sstable_cnt,
|
||||
ObGetMergeTablesResult &result)
|
||||
@ -150,6 +176,8 @@ void TestParallelMinorDag::check_result(
|
||||
}
|
||||
}
|
||||
|
||||
namespace unittest
|
||||
{
|
||||
TEST_F(TestParallelMinorDag, test_parallel_interval)
|
||||
{
|
||||
for (int64_t minor_compact_trigger = 2; minor_compact_trigger <= 16; ++minor_compact_trigger) {
|
||||
|
Reference in New Issue
Block a user