[dblink] refine print xid in tm rm start
This commit is contained in:
		@ -129,17 +129,18 @@ int ObTMService::tm_rm_start(ObExecContext &exec_ctx,
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // step 3, xa start for dblink connection
 | 
					  // step 3, xa start for dblink connection
 | 
				
			||||||
 | 
					  ObXATransID remote_xid;
 | 
				
			||||||
  if (OB_SUCCESS != ret) {
 | 
					  if (OB_SUCCESS != ret) {
 | 
				
			||||||
  } else if (OB_FAIL(xa_service->xa_start_for_dblink_client(dblink_type,
 | 
					  } else if (OB_FAIL(xa_service->xa_start_for_dblink_client(dblink_type,
 | 
				
			||||||
          dblink_conn, tx_desc))) {
 | 
					          dblink_conn, tx_desc, remote_xid))) {
 | 
				
			||||||
    LOG_WARN("fail to execute xa start for dblink client", K(ret), K(xid));
 | 
					    LOG_WARN("fail to execute xa start for dblink client", K(ret), K(xid), K(remote_xid));
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    tx_id = tx_desc->tid();
 | 
					    tx_id = tx_desc->tid();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  my_session->get_raw_audit_record().trans_id_ = my_session->get_tx_id();
 | 
					  my_session->get_raw_audit_record().trans_id_ = my_session->get_tx_id();
 | 
				
			||||||
  LOG_INFO("tm rm start", K(ret), K(tx_id), K(xid), K(need_start), K(need_promote));
 | 
					  LOG_INFO("tm rm start", K(ret), K(tx_id), K(remote_xid), K(need_start), K(need_promote));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO, if fail, the trans needs rollback
 | 
					  // if fail, the trans should be rolled back by client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return ret;
 | 
					  return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -429,7 +429,8 @@ int ObXAService::xa_start_for_tm_(const int64_t flags,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int ObXAService::xa_start_for_dblink_client(const DblinkDriverProto dblink_type,
 | 
					int ObXAService::xa_start_for_dblink_client(const DblinkDriverProto dblink_type,
 | 
				
			||||||
                                            ObISQLConnection *dblink_conn,
 | 
					                                            ObISQLConnection *dblink_conn,
 | 
				
			||||||
                                            ObTxDesc *&tx_desc)
 | 
					                                            ObTxDesc *&tx_desc,
 | 
				
			||||||
 | 
					                                            ObXATransID &remote_xid)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int ret = OB_SUCCESS;
 | 
					  int ret = OB_SUCCESS;
 | 
				
			||||||
  if (NULL == tx_desc || !tx_desc->is_valid()) {
 | 
					  if (NULL == tx_desc || !tx_desc->is_valid()) {
 | 
				
			||||||
@ -453,9 +454,9 @@ int ObXAService::xa_start_for_dblink_client(const DblinkDriverProto dblink_type,
 | 
				
			|||||||
      ret = OB_ERR_UNEXPECTED;
 | 
					      ret = OB_ERR_UNEXPECTED;
 | 
				
			||||||
      TRANS_LOG(WARN, "unexpected dblink client", K(ret), K(xid), K(tx_id));
 | 
					      TRANS_LOG(WARN, "unexpected dblink client", K(ret), K(xid), K(tx_id));
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      ObXATransID remote_xid;
 | 
					 | 
				
			||||||
      if (client->is_started(xid)) {
 | 
					      if (client->is_started(xid)) {
 | 
				
			||||||
        // return success
 | 
					        // return success
 | 
				
			||||||
 | 
					        remote_xid = client->get_xid();
 | 
				
			||||||
      } else if (OB_FAIL(ObXAService::generate_xid_with_new_bqual(xid,
 | 
					      } else if (OB_FAIL(ObXAService::generate_xid_with_new_bqual(xid,
 | 
				
			||||||
              client->get_index(), remote_xid))) {
 | 
					              client->get_index(), remote_xid))) {
 | 
				
			||||||
        TRANS_LOG(WARN, "fail to generate xid", K(ret), K(xid), K(tx_id), K(remote_xid));
 | 
					        TRANS_LOG(WARN, "fail to generate xid", K(ret), K(xid), K(tx_id), K(remote_xid));
 | 
				
			||||||
 | 
				
			|||||||
@ -103,7 +103,8 @@ public:
 | 
				
			|||||||
                      ObXATransID &xid);
 | 
					                      ObXATransID &xid);
 | 
				
			||||||
  int xa_start_for_dblink_client(const common::sqlclient::DblinkDriverProto dblink_type,
 | 
					  int xa_start_for_dblink_client(const common::sqlclient::DblinkDriverProto dblink_type,
 | 
				
			||||||
                                 common::sqlclient::ObISQLConnection *dblink_conn,
 | 
					                                 common::sqlclient::ObISQLConnection *dblink_conn,
 | 
				
			||||||
                                 ObTxDesc *&tx_desc);
 | 
					                                 ObTxDesc *&tx_desc,
 | 
				
			||||||
 | 
					                                 ObXATransID &remote_xid);
 | 
				
			||||||
  int commit_for_dblink_trans(ObTxDesc *&tx_desc);
 | 
					  int commit_for_dblink_trans(ObTxDesc *&tx_desc);
 | 
				
			||||||
  int rollback_for_dblink_trans(ObTxDesc *&tx_desc);
 | 
					  int rollback_for_dblink_trans(ObTxDesc *&tx_desc);
 | 
				
			||||||
  static int generate_xid(const ObTransID &tx_id, ObXATransID &new_xid);
 | 
					  static int generate_xid(const ObTransID &tx_id, ObXATransID &new_xid);
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user