[LOCK_WAIT_MGR] let the sess_id to be set by post_lock directly
This commit is contained in:
2
deps/oblib/src/rpc/ob_lock_wait_node.cpp
vendored
2
deps/oblib/src/rpc/ob_lock_wait_node.cpp
vendored
@ -31,6 +31,7 @@ void ObLockWaitNode::set(void* addr,
|
|||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
const char* key,
|
const char* key,
|
||||||
|
const uint32_t sess_id,
|
||||||
int64_t tx_id,
|
int64_t tx_id,
|
||||||
int64_t holder_tx_id) {
|
int64_t holder_tx_id) {
|
||||||
hash_ = hash | 1;
|
hash_ = hash | 1;
|
||||||
@ -39,6 +40,7 @@ void ObLockWaitNode::set(void* addr,
|
|||||||
lock_seq_ = lock_seq;
|
lock_seq_ = lock_seq;
|
||||||
abs_timeout_ = timeout;
|
abs_timeout_ = timeout;
|
||||||
tablet_id_ = tablet_id;//used for gv$lock_wait_stat
|
tablet_id_ = tablet_id;//used for gv$lock_wait_stat
|
||||||
|
sessid_ = sess_id;
|
||||||
tx_id_ = tx_id;//requester used for deadlock detection
|
tx_id_ = tx_id;//requester used for deadlock detection
|
||||||
holder_tx_id_ = holder_tx_id; // txn id of lock holder
|
holder_tx_id_ = holder_tx_id; // txn id of lock holder
|
||||||
last_compact_cnt_ = last_compact_cnt,
|
last_compact_cnt_ = last_compact_cnt,
|
||||||
|
|||||||
1
deps/oblib/src/rpc/ob_lock_wait_node.h
vendored
1
deps/oblib/src/rpc/ob_lock_wait_node.h
vendored
@ -35,6 +35,7 @@ struct ObLockWaitNode: public common::SpHashNode
|
|||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
const char* key,
|
const char* key,
|
||||||
|
const uint32_t sess_id,
|
||||||
int64_t tx_id,
|
int64_t tx_id,
|
||||||
int64_t holder_tx_id);
|
int64_t holder_tx_id);
|
||||||
void change_hash(const int64_t hash, const int64_t lock_seq);
|
void change_hash(const int64_t hash, const int64_t lock_seq);
|
||||||
|
|||||||
@ -212,8 +212,6 @@ int ObMPQuery::process()
|
|||||||
retry_ctrl_.set_sys_global_schema_version(sys_version);
|
retry_ctrl_.set_sys_global_schema_version(sys_version);
|
||||||
session.partition_hit().reset();
|
session.partition_hit().reset();
|
||||||
session.set_pl_can_retry(true);
|
session.set_pl_can_retry(true);
|
||||||
ObLockWaitNode &lock_wait_node = req_->get_lock_wait_node();
|
|
||||||
lock_wait_node.set_session_info(session.get_sessid());
|
|
||||||
|
|
||||||
bool has_more = false;
|
bool has_more = false;
|
||||||
bool force_sync_resp = false;
|
bool force_sync_resp = false;
|
||||||
|
|||||||
@ -1870,8 +1870,6 @@ int ObMPStmtExecute::process()
|
|||||||
retry_ctrl_.set_sys_global_schema_version(sys_version);
|
retry_ctrl_.set_sys_global_schema_version(sys_version);
|
||||||
session.partition_hit().reset();
|
session.partition_hit().reset();
|
||||||
session.set_pl_can_retry(true);
|
session.set_pl_can_retry(true);
|
||||||
ObLockWaitNode &lock_wait_node = req_->get_lock_wait_node();
|
|
||||||
lock_wait_node.set_session_info(session.get_sessid());
|
|
||||||
|
|
||||||
need_response_error = false;
|
need_response_error = false;
|
||||||
need_disconnect = false;
|
need_disconnect = false;
|
||||||
|
|||||||
@ -571,6 +571,7 @@ int ObLockWaitMgr::post_lock(const int tmp_ret,
|
|||||||
const bool is_remote_sql,
|
const bool is_remote_sql,
|
||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
|
const uint32_t sess_id,
|
||||||
const ObTransID &tx_id,
|
const ObTransID &tx_id,
|
||||||
const ObTransID &holder_tx_id,
|
const ObTransID &holder_tx_id,
|
||||||
ObFunction<int(bool&, bool&)> &rechecker)
|
ObFunction<int(bool&, bool&)> &rechecker)
|
||||||
@ -604,6 +605,7 @@ int ObLockWaitMgr::post_lock(const int tmp_ret,
|
|||||||
last_compact_cnt,
|
last_compact_cnt,
|
||||||
total_trans_node_cnt,
|
total_trans_node_cnt,
|
||||||
to_cstring(row_key),// just for virtual table display
|
to_cstring(row_key),// just for virtual table display
|
||||||
|
sess_id,
|
||||||
tx_id,
|
tx_id,
|
||||||
holder_tx_id);
|
holder_tx_id);
|
||||||
node->set_need_wait();
|
node->set_need_wait();
|
||||||
@ -621,6 +623,7 @@ int ObLockWaitMgr::post_lock(const int tmp_ret,
|
|||||||
const bool is_remote_sql,
|
const bool is_remote_sql,
|
||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
|
const uint32_t sess_id,
|
||||||
const transaction::ObTransID &tx_id,
|
const transaction::ObTransID &tx_id,
|
||||||
const transaction::ObTransID &holder_tx_id,
|
const transaction::ObTransID &holder_tx_id,
|
||||||
const ObTableLockMode &lock_mode,
|
const ObTableLockMode &lock_mode,
|
||||||
@ -659,6 +662,7 @@ int ObLockWaitMgr::post_lock(const int tmp_ret,
|
|||||||
last_compact_cnt,
|
last_compact_cnt,
|
||||||
total_trans_node_cnt,
|
total_trans_node_cnt,
|
||||||
lock_id_buf, // just for virtual table display
|
lock_id_buf, // just for virtual table display
|
||||||
|
sess_id,
|
||||||
tx_id,
|
tx_id,
|
||||||
holder_tx_id);
|
holder_tx_id);
|
||||||
node->set_need_wait();
|
node->set_need_wait();
|
||||||
|
|||||||
@ -237,6 +237,7 @@ public:
|
|||||||
const bool is_remote_sql,
|
const bool is_remote_sql,
|
||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
|
const uint32_t sess_id,
|
||||||
const transaction::ObTransID &tx_id,
|
const transaction::ObTransID &tx_id,
|
||||||
const transaction::ObTransID &holder_tx_id,
|
const transaction::ObTransID &holder_tx_id,
|
||||||
ObFunction<int(bool&, bool&)> &rechecker);
|
ObFunction<int(bool&, bool&)> &rechecker);
|
||||||
@ -247,6 +248,7 @@ public:
|
|||||||
const bool is_remote_sql,
|
const bool is_remote_sql,
|
||||||
const int64_t last_compact_cnt,
|
const int64_t last_compact_cnt,
|
||||||
const int64_t total_trans_node_cnt,
|
const int64_t total_trans_node_cnt,
|
||||||
|
const uint32_t sess_id,
|
||||||
const transaction::ObTransID &tx_id,
|
const transaction::ObTransID &tx_id,
|
||||||
const transaction::ObTransID &holder_tx_id,
|
const transaction::ObTransID &holder_tx_id,
|
||||||
const transaction::tablelock::ObTableLockMode &lock_mode,
|
const transaction::tablelock::ObTableLockMode &lock_mode,
|
||||||
|
|||||||
@ -2986,6 +2986,7 @@ int ObMemtable::post_row_write_conflict_(ObMvccAccessCtx &acc_ctx,
|
|||||||
remote_tx,
|
remote_tx,
|
||||||
last_compact_cnt,
|
last_compact_cnt,
|
||||||
total_trans_node_cnt,
|
total_trans_node_cnt,
|
||||||
|
acc_ctx.tx_desc_->get_session_id(),
|
||||||
tx_id,
|
tx_id,
|
||||||
conflict_tx_id,
|
conflict_tx_id,
|
||||||
recheck_func);
|
recheck_func);
|
||||||
|
|||||||
@ -158,6 +158,7 @@ int ObRowConflictHandler::post_row_read_conflict(ObMvccAccessCtx &acc_ctx,
|
|||||||
remote_tx,
|
remote_tx,
|
||||||
last_compact_cnt,
|
last_compact_cnt,
|
||||||
total_trans_node_cnt,
|
total_trans_node_cnt,
|
||||||
|
tx_desc->get_session_id(),
|
||||||
tx_id,
|
tx_id,
|
||||||
conflict_tx_id,
|
conflict_tx_id,
|
||||||
recheck_func);
|
recheck_func);
|
||||||
|
|||||||
@ -391,6 +391,7 @@ int ObLockMemtable::post_obj_lock_conflict_(ObMvccAccessCtx &acc_ctx,
|
|||||||
remote_tx,
|
remote_tx,
|
||||||
-1,
|
-1,
|
||||||
-1, // total_trans_node_cnt
|
-1, // total_trans_node_cnt
|
||||||
|
acc_ctx.tx_desc_->get_session_id(),
|
||||||
tx_id,
|
tx_id,
|
||||||
conflict_tx_id,
|
conflict_tx_id,
|
||||||
lock_mode,
|
lock_mode,
|
||||||
|
|||||||
Reference in New Issue
Block a user