[FEAT MERGE] OLTP performance and cpu reduction optimization under tiny specification
Co-authored-by: hezuojiao <hezuojiao@gmail.com>
This commit is contained in:
@ -1149,6 +1149,20 @@ TEST_F(TestTxCallbackList, checksum_all_and_tx_end_test) {
|
||||
|
||||
namespace memtable
|
||||
{
|
||||
void ObMemtableCtx::callback_free(ObITransCallback *cb)
|
||||
{
|
||||
if (OB_ISNULL(cb)) {
|
||||
TRANS_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "cb is null, unexpected error", KP(cb), K(*this));
|
||||
} else if (cb->is_table_lock_callback()) {
|
||||
free_table_lock_callback(cb);
|
||||
} else {
|
||||
ATOMIC_INC(&callback_free_count_);
|
||||
TRANS_LOG(DEBUG, "callback release succ", KP(cb), K(*this), K(lbt()));
|
||||
ctx_cb_allocator_.free(cb);
|
||||
cb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int ObTxCallbackList::remove_callbacks_for_fast_commit(bool &has_remove)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -248,8 +248,6 @@ int MockObServer::init_multi_tenant()
|
||||
STORAGE_LOG(WARN, "init multi_tenant failed", K(ret));
|
||||
} else if (OB_SUCCESS != (ret = multi_tenant_.create_tenant_without_unit(OB_SYS_TENANT_ID, 3, 3))) {
|
||||
STORAGE_LOG(WARN, "add sys tenant failed", K(ret));
|
||||
} else if (OB_SUCCESS != (ret = multi_tenant_.create_tenant_without_unit(OB_ELECT_TENANT_ID, 5, 5))) {
|
||||
STORAGE_LOG(WARN, "add election tenant failed", K(ret));
|
||||
} else if (OB_SUCCESS != (ret = multi_tenant_.create_tenant_without_unit(OB_SERVER_TENANT_ID, 5, 5))) {
|
||||
STORAGE_LOG(WARN, "add election tenant failed", K(ret));
|
||||
} else {
|
||||
|
||||
@ -597,6 +597,7 @@ int ObTxNode::write(ObTxDesc &tx,
|
||||
write_store_ctx.mvcc_acc_ctx_.tx_table_guard_.init(&fake_tx_table_);
|
||||
ObArenaAllocator allocator;
|
||||
ObTableReadInfo read_info;
|
||||
const transaction::ObSerializeEncryptMeta *encrypt_meta = NULL;
|
||||
const int64_t schema_version = 100;
|
||||
read_info.init(allocator, schema_version, 1, false, columns_);
|
||||
ObStoreRow row;
|
||||
@ -606,7 +607,7 @@ int ObTxNode::write(ObTxDesc &tx,
|
||||
row.row_val_.count_ = 2;
|
||||
row.flag_ = blocksstable::ObDmlFlag::DF_UPDATE;
|
||||
row.trans_id_.reset();
|
||||
OZ(memtable_->set(write_store_ctx, 1, read_info, columns_, row));
|
||||
OZ(memtable_->set(write_store_ctx, 1, read_info, columns_, row, encrypt_meta));
|
||||
OZ(txs_.revert_store_ctx(write_store_ctx));
|
||||
delete iter;
|
||||
return ret;
|
||||
@ -639,6 +640,7 @@ int ObTxNode::write_one_row(ObStoreCtx& write_store_ctx, const int64_t key, cons
|
||||
|
||||
ObArenaAllocator allocator;
|
||||
ObTableReadInfo read_info;
|
||||
const transaction::ObSerializeEncryptMeta *encrypt_meta = NULL;
|
||||
const int64_t schema_version = 100;
|
||||
read_info.init(allocator, schema_version, 1, false, columns_);
|
||||
ObStoreRow row;
|
||||
@ -646,7 +648,7 @@ int ObTxNode::write_one_row(ObStoreCtx& write_store_ctx, const int64_t key, cons
|
||||
row.flag_ = blocksstable::ObDmlFlag::DF_INSERT;
|
||||
row.row_val_.cells_ = cols;
|
||||
row.row_val_.count_ = 2;
|
||||
OZ(memtable_->set(write_store_ctx, 1, read_info, columns_, row));
|
||||
OZ(memtable_->set(write_store_ctx, 1, read_info, columns_, row, encrypt_meta));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -635,8 +635,7 @@ private:
|
||||
}
|
||||
|
||||
int replay_one_row_in_memtable_(memtable::ObMutatorRowHeader& row_head,
|
||||
memtable::ObMemtableMutatorIterator *mmi_ptr,
|
||||
memtable::ObEncryptRowBuf &row_buf) override
|
||||
memtable::ObMemtableMutatorIterator *mmi_ptr) override
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
storage::ObStoreCtx storeCtx;
|
||||
@ -649,7 +648,7 @@ private:
|
||||
|
||||
switch (row_head.mutator_type_) {
|
||||
case memtable::MutatorType::MUTATOR_ROW: {
|
||||
if (OB_FAIL(memtable_->replay_row(storeCtx, mmi_ptr_, row_buf))) {
|
||||
if (OB_FAIL(memtable_->replay_row(storeCtx, mmi_ptr_))) {
|
||||
TRANS_LOG(WARN, "[Replay Tx] replay row error", K(ret));
|
||||
} else {
|
||||
TRANS_LOG(INFO, "[Replay Tx] replay row in memtable success");
|
||||
|
||||
@ -60,8 +60,6 @@ int MockObTxCtx::init(const ObLSID &ls_id,
|
||||
// ======================= mock trans ctx end ========================
|
||||
} else if (OB_FAIL(init_log_cbs_(ls_id, trans_id))) {
|
||||
TRANS_LOG(WARN, "init log cbs failed", KR(ret), K(trans_id), K(ls_id));
|
||||
} else if (OB_FAIL(clog_encrypt_info_.init())) {
|
||||
TRANS_LOG(WARN, "init clog encrypt info failed", K(ret), KPC(this), K(trans_id));
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
|
||||
@ -325,9 +325,7 @@ TEST_F(TestObTxLog, tx_log_body_redo)
|
||||
|
||||
ObString TEST_MUTATOR_BUF("FFF");
|
||||
int64_t mutator_pos = 0;
|
||||
ObCLogEncryptInfo TEST_CLOG_ENCRYPT_INFO;
|
||||
TEST_CLOG_ENCRYPT_INFO.init();
|
||||
ObTxRedoLog fill_redo(TEST_CLOG_ENCRYPT_INFO, TEST_LOG_NO, TEST_CLUSTER_VERSION);
|
||||
ObTxRedoLog fill_redo(TEST_LOG_NO, TEST_CLUSTER_VERSION);
|
||||
ASSERT_EQ(OB_SUCCESS, fill_block.prepare_mutator_buf(fill_redo));
|
||||
ASSERT_EQ(OB_SUCCESS,
|
||||
serialization::encode(fill_redo.get_mutator_buf(),
|
||||
|
||||
Reference in New Issue
Block a user