[FEAT MERGE] shared_nothing_tmp_file

Co-authored-by: lalalafeier <wufeifei2023@163.com>
Co-authored-by: wanyue-wy <345657357@qq.com>
Co-authored-by: simonjoylet <simonjoylet@gmail.com>
This commit is contained in:
obdev
2024-08-15 12:12:57 +00:00
committed by ob-robot
parent c189ffd722
commit a897079037
98 changed files with 25410 additions and 9474 deletions

View File

@ -20,6 +20,7 @@
#include "storage/backup/ob_backup_data_struct.h"
#include "storage/blocksstable/ob_data_file_prepare.h"
#include "test_backup.h"
#include "mtlenv/mock_tenant_module_env.h"
using namespace oceanbase;
using namespace oceanbase::common;
@ -66,8 +67,10 @@ void TestBackupTmpFile::SetUp()
}
// set observer memory limit
CHUNK_MGR.set_limit(8L * 1024L * 1024L * 1024L);
ret = ObTmpFileManager::get_instance().init();
ASSERT_EQ(OB_SUCCESS, ret);
ASSERT_EQ(OB_SUCCESS, common::ObClockGenerator::init());
ASSERT_EQ(OB_SUCCESS, tmp_file::ObTmpBlockCache::get_instance().init("tmp_block_cache", 1));
ASSERT_EQ(OB_SUCCESS, tmp_file::ObTmpPageCache::get_instance().init("tmp_page_cache", 1));
static ObTenantBase tenant_ctx(OB_SYS_TENANT_ID);
ObTenantEnv::set_tenant(&tenant_ctx);
ObTenantIOManager *io_service = nullptr;
@ -75,14 +78,24 @@ void TestBackupTmpFile::SetUp()
EXPECT_EQ(OB_SUCCESS, ObTenantIOManager::mtl_init(io_service));
EXPECT_EQ(OB_SUCCESS, io_service->start());
tenant_ctx.set(io_service);
tmp_file::ObTenantTmpFileManager *tf_mgr = nullptr;
EXPECT_EQ(OB_SUCCESS, mtl_new_default(tf_mgr));
EXPECT_EQ(OB_SUCCESS, tmp_file::ObTenantTmpFileManager::mtl_init(tf_mgr));
tf_mgr->page_cache_controller_.write_buffer_pool_.default_wbp_memory_limit_ = 40*1024*1024;
EXPECT_EQ(OB_SUCCESS, tf_mgr->start());
tenant_ctx.set(tf_mgr);
ObTenantEnv::set_tenant(&tenant_ctx);
}
void TestBackupTmpFile::TearDown()
{
ObTmpFileManager::get_instance().destroy();
tmp_file::ObTmpBlockCache::get_instance().destroy();
tmp_file::ObTmpPageCache::get_instance().destroy();
ObKVGlobalCache::get_instance().destroy();
TestDataFilePrepare::TearDown();
common::ObClockGenerator::destroy();
}
static void make_meta_index(backup::ObBackupMetaIndex &meta_index)