[FEAT MERGE] remove retain_ctx use tx_data to hold mds op and optimise transfer move tx with check tx is needed
This commit is contained in:
@ -142,6 +142,7 @@ public:
|
||||
auto test_name = test_info->name();
|
||||
MTL_MEM_ALLOC_MGR.init();
|
||||
_TRANS_LOG(INFO, ">>>> starting test : %s", test_name);
|
||||
LOG_INFO(">>>>>>starting>>>>>>>>", K(test_name));
|
||||
}
|
||||
virtual void TearDown() override
|
||||
{
|
||||
@ -151,6 +152,7 @@ public:
|
||||
_TRANS_LOG(INFO, ">>>> tearDown test : %s", test_name);
|
||||
ObClockGenerator::destroy();
|
||||
ObMallocAllocator::get_instance()->recycle_tenant_allocator(1001);
|
||||
LOG_INFO(">>>>>teardown>>>>>>>>", K(test_name));
|
||||
}
|
||||
MsgBus bus_;
|
||||
};
|
||||
|
@ -37,7 +37,10 @@ namespace transaction {
|
||||
class ObFakeTxDataTable : public ObTxDataTable {
|
||||
public:
|
||||
ObSliceAlloc slice_allocator_;
|
||||
ObTenantTxDataAllocator *FAKE_ALLOCATOR = (ObTenantTxDataAllocator *)0x1;
|
||||
ObTenantTxDataAllocator __FAKE_ALLOCATOR_OBJ;
|
||||
ObTenantTxDataAllocator *FAKE_ALLOCATOR = &__FAKE_ALLOCATOR_OBJ;
|
||||
ObTenantTxDataOpAllocator __FAKE_ALLOCATOR_OBJ2;
|
||||
ObTenantTxDataOpAllocator *FAKE_ALLOCATOR2 = &__FAKE_ALLOCATOR_OBJ2;
|
||||
|
||||
public:
|
||||
ObFakeTxDataTable() : arena_allocator_(), map_(arena_allocator_, 1 << 20 /*2097152*/)
|
||||
@ -51,6 +54,8 @@ public:
|
||||
OB_ASSERT(OB_SUCCESS == slice_allocator_.init(
|
||||
sizeof(ObTxData), OB_MALLOC_NORMAL_BLOCK_SIZE, common::default_blk_alloc, mem_attr));
|
||||
slice_allocator_.set_nway(32);
|
||||
FAKE_ALLOCATOR->init("FAKE_A");
|
||||
FAKE_ALLOCATOR2->init();
|
||||
is_inited_ = true;
|
||||
}
|
||||
virtual int init(ObLS *ls, ObTxCtxTable *tx_ctx_table) override
|
||||
@ -70,6 +75,7 @@ public:
|
||||
ObTxData *tx_data = new (ptr) ObTxData();
|
||||
tx_data->ref_cnt_ = 100;
|
||||
tx_data->tx_data_allocator_ = FAKE_ALLOCATOR;
|
||||
tx_data->op_allocator_ = FAKE_ALLOCATOR2;
|
||||
tx_data_guard.init(tx_data);
|
||||
return OB_ISNULL(tx_data) ? OB_ALLOCATE_MEMORY_FAILED : OB_SUCCESS;
|
||||
}
|
||||
@ -83,7 +89,6 @@ public:
|
||||
to->tx_data_allocator_ = FAKE_ALLOCATOR;
|
||||
to_guard.init(to);
|
||||
OX (*to = *from);
|
||||
OZ (deep_copy_undo_status_list_(from->undo_status_list_, to->undo_status_list_));
|
||||
return ret;
|
||||
}
|
||||
virtual void free_tx_data(ObTxData *tx_data)
|
||||
|
@ -190,6 +190,7 @@ public:
|
||||
ObIMemtableMgr *mt_mgr_;
|
||||
ObTxCtxMemtableMgr *ctx_mt_mgr_;
|
||||
ObTenantTxDataAllocator tx_data_allocator_;
|
||||
ObTenantTxDataOpAllocator tx_data_op_allocator_;
|
||||
|
||||
ObTenantBase tenant_base_;
|
||||
};
|
||||
@ -304,6 +305,7 @@ TEST_F(TestTxCtxTable, test_tx_ctx_memtable_mgr)
|
||||
attr.tenant_id_ = MTL_ID();
|
||||
tx_data_allocator_.init("test");
|
||||
tx_data_table.tx_data_allocator_ = &tx_data_allocator_;
|
||||
tx_data_op_allocator_.init();
|
||||
|
||||
ObTxPalfParam palf_param((logservice::ObLogHandler *)(0x01),
|
||||
(transaction::ObDupTableLSHandler *)(0x02));
|
||||
|
Reference in New Issue
Block a user