[fix](group commit)Fix the issue of duplicate addition of wal path when encouter exception (#28691)

This commit is contained in:
huanghaibin
2023-12-21 20:27:33 +08:00
committed by GitHub
parent ba4033ad2e
commit 0070909d30
8 changed files with 8 additions and 9 deletions

View File

@ -358,7 +358,6 @@ Status GroupCommitTable::_finish_group_commit_load(int64_t db_id, int64_t table_
<< ", executor status=" << status.to_string()
<< ", request commit status=" << st.to_string();
if (!prepare_failed) {
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_wal_path(_db_id, table_id, txn_id, label));
std::string wal_path;
RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, wal_path));
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(
@ -375,7 +374,6 @@ Status GroupCommitTable::_finish_group_commit_load(int64_t db_id, int64_t table_
// TODO handle execute and commit error
if (!prepare_failed && !result_status.ok() &&
!(result_status.is<ErrorCode::PUBLISH_TIMEOUT>())) {
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_wal_path(_db_id, table_id, txn_id, label));
std::string wal_path;
RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, wal_path));
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(std::to_string(db_id),