From cef1d4186fc3a54fdb018ac0e91324bb499219ca Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 4 Apr 2023 05:44:36 +0000 Subject: [PATCH] [foreign key] fix a bug about not handle error code during posting conflict tx to deadlock detector --- src/storage/memtable/ob_row_conflict_handler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/memtable/ob_row_conflict_handler.cpp b/src/storage/memtable/ob_row_conflict_handler.cpp index b2cde13fb..d17d90a05 100644 --- a/src/storage/memtable/ob_row_conflict_handler.cpp +++ b/src/storage/memtable/ob_row_conflict_handler.cpp @@ -118,12 +118,14 @@ int ObRowConflictHandler::post_row_read_conflict(ObMvccAccessCtx &acc_ctx, int tmp_ret = OB_SUCCESS; ObTransID tx_id = acc_ctx.get_tx_id(); ObAddr conflict_scheduler_addr; + // register to deadlock detector if (OB_FAIL(ObTransDeadlockDetectorAdapter:: get_trans_scheduler_info_on_participant(conflict_tx_id, ls_id, conflict_scheduler_addr))) { TRANS_LOG(WARN, "get transaction scheduler info fail", K(ret), K(conflict_tx_id), K(tx_id), K(ls_id)); + } else { + ObTransIDAndAddr conflict_tx(conflict_tx_id, conflict_scheduler_addr); + tx_desc->add_conflict_tx(conflict_tx); } - ObTransIDAndAddr conflict_tx(conflict_tx_id, conflict_scheduler_addr); - tx_desc->add_conflict_tx(conflict_tx); // The addr in tx_desc is the scheduler_addr of current trans, // and GCTX.self_addr() will retrun the addr where the row is stored // (i.e. where the trans is executing)