[BUG] add protection code when commit

This commit is contained in:
Handora
2022-11-17 13:35:42 +00:00
committed by wangzelin.wzl
parent afc6d5958c
commit 8e6003153c

View File

@ -685,7 +685,10 @@ int ObPartTransCtx::commit(const ObLSArray &parts,
} else {
set_stc_by_now_();
}
if (parts.count() == 1 && parts[0] == ls_id_) {
if (parts.count() <= 0) {
ret = OB_ERR_UNEXPECTED;
TRANS_LOG(ERROR, "the size of participant is 0 when commit", KPC(this));
} else if (parts.count() == 1 && parts[0] == ls_id_) {
exec_info_.trans_type_ = TransType::SP_TRANS;
if (OB_FAIL(one_phase_commit_())) {
TRANS_LOG(WARN, "start sp coimit fail", K(ret), KPC(this));