Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
1f41bcc0
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1f41bcc0
编写于
3月 22, 2023
作者:
O
obdev
提交者:
ob-robot
3月 22, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix delay abort bug
上级
aac70058
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
15 deletion
+38
-15
src/storage/tx/ob_trans_part_ctx.cpp
src/storage/tx/ob_trans_part_ctx.cpp
+38
-15
未找到文件。
src/storage/tx/ob_trans_part_ctx.cpp
浏览文件 @
1f41bcc0
...
...
@@ -1658,10 +1658,11 @@ int ObPartTransCtx::compensate_abort_log_()
int ret = OB_SUCCESS;
if (is_force_abort_logging_()) {
// do nothing
} else if(OB_FALSE_IT(sub_state_.set_force_abort())) {
} else if (OB_FAIL(submit_log_impl_(ObTxLogType::TX_ABORT_LOG))) {
TRANS_LOG(WARN, "submit abort log failed", KR(ret), K(*this));
} else {
sub_state_.set_force_abort();
}
TRANS_LOG(INFO, "compensate abort log", K(ret), KPC(this));
return ret;
...
...
@@ -2556,7 +2557,11 @@ int ObPartTransCtx::submit_redo_commit_info_log_()
ObTxLogBlockHeader
log_block_header(cluster_id_, exec_info_.next_log_entry_no_, trans_id_, exec_info_.scheduler_);
if (sub_state_.is_info_log_submitted()) {
if (need_force_abort_() || is_force_abort_logging_()
|| get_downstream_state() == ObTxState::ABORT) {
ret = OB_TRANS_KILLED;
TRANS_LOG(WARN, "tx has been aborting, can not submit prepare log", K(ret));
} else if (sub_state_.is_info_log_submitted()) {
// state log already submitted, do nothing
} else if (OB_FAIL(log_block.init(replay_hint, log_block_header))) {
TRANS_LOG(WARN, "init log block failed", KR(ret), K(*this));
...
...
@@ -2789,19 +2794,26 @@ int ObPartTransCtx::submit_prepare_log_()
ObTxLogBlockHeader
log_block_header(cluster_id_, exec_info_.next_log_entry_no_, trans_id_, exec_info_.scheduler_);
if (OB_FAIL(log_block.init(replay_hint, log_block_header))) {
TRANS_LOG(WARN, "init log block failed", KR(ret), K(*this));
} else if (!sub_state_.is_info_log_submitted()) {
prev_lsn.reset();
if (OB_FAIL(submit_multi_data_source_(log_block))) {
TRANS_LOG(WARN, "submit multi source data failed", KR(ret), K(*this));
} else if (OB_FAIL(submit_redo_commit_info_log_(log_block, has_redo, helper))) {
TRANS_LOG(WARN, "submit redo commit state log failed", KR(ret), K(*this));
} else {
// do nothing
}
if (need_force_abort_() || is_force_abort_logging_()
|| get_downstream_state() == ObTxState::ABORT) {
ret = OB_TRANS_KILLED;
TRANS_LOG(WARN, "tx has been aborting, can not submit prepare log", K(ret));
}
if (OB_SUCC(ret)) {
if (OB_FAIL(log_block.init(replay_hint, log_block_header))) {
TRANS_LOG(WARN, "init log block failed", KR(ret), K(*this));
} else if (!sub_state_.is_info_log_submitted()) {
prev_lsn.reset();
if (OB_FAIL(submit_multi_data_source_(log_block))) {
TRANS_LOG(WARN, "submit multi source data failed", KR(ret), K(*this));
} else if (OB_FAIL(submit_redo_commit_info_log_(log_block, has_redo, helper))) {
TRANS_LOG(WARN, "submit redo commit state log failed", KR(ret), K(*this));
} else {
// do nothing
}
}
}
if (OB_SUCC(ret)) {
ObTxLogCb *log_cb = NULL;
...
...
@@ -2912,7 +2924,11 @@ int ObPartTransCtx::submit_commit_log_()
log_block_header(cluster_id_, exec_info_.next_log_entry_no_, trans_id_, exec_info_.scheduler_);
const bool local_tx = is_local_tx_();
if (OB_FAIL(gen_final_mds_array_(multi_source_data))) {
if (need_force_abort_() || is_force_abort_logging_()
|| get_downstream_state() == ObTxState::ABORT) {
ret = OB_TRANS_KILLED;
TRANS_LOG(WARN, "tx has been aborting, can not submit prepare log", K(ret));
} else if (OB_FAIL(gen_final_mds_array_(multi_source_data))) {
TRANS_LOG(WARN, "gen total multi source data failed", KR(ret), K(*this));
} else {
bool use_local_block_buf = local_tx
...
...
@@ -4962,7 +4978,14 @@ int ObPartTransCtx::switch_to_leader(const SCN &start_working_ts)
} else {
TRANS_LOG(WARN, "txn data incomplete, will be aborted", K(contain_table_lock), KPC(this));
if (has_persisted_log_()) {
if (OB_FAIL(do_local_tx_end_(TxEndAction::DELAY_ABORT_TX))) {
if (ObPartTransAction::COMMIT == part_trans_action_ || get_upstream_state() >= ObTxState::PREPARE) {
TRANS_LOG(WARN, "abort self instantly with a tx_commit request", K(contain_table_lock),
KPC(this));
if (OB_FAIL(do_local_tx_end_(TxEndAction::ABORT_TX))) {
TRANS_LOG(WARN, "abort tx failed", KR(ret), KPC(this));
}
} else if (OB_FAIL(do_local_tx_end_(TxEndAction::DELAY_ABORT_TX))) {
TRANS_LOG(WARN, "abort tx failed", KR(ret), K(*this));
}
} else {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录