morningman commented on a change in pull request #2718: [Insert] Return more info of insert operation URL: https://github.com/apache/incubator-doris/pull/2718#discussion_r366346293
########## File path: fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java ########## @@ -1220,6 +1214,63 @@ private void updateDBRunningTxnNum(TransactionStatus preStatus, TransactionState return infos; } + // get show info of a specified txnId + public List<List<String>> getSingleTranInfo(long dbId, long txnId) throws AnalysisException { + List<List<String>> infos = new ArrayList<List<String>>(); + readLock(); + try { + Database db = Catalog.getInstance().getDb(dbId); + if (db == null) { + throw new AnalysisException("Database[" + dbId + "] does not exist"); + } + + TransactionState txnState = idToTransactionState.get(txnId); + if (txnState == null) { + throw new AnalysisException("transaction with id " + txnId + " does not exist"); + } + + if (ConnectContext.get() != null) { Review comment: This method may be called internal, not in user connection thread. So I just add a judgement here. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org