@Override
  public void replCommitTxn(CommitTxnRequest rqst) throws LockException {
    try {
      if (rqst.isSetReplLastIdInfo()) {
        if (!isTxnOpen()) {
          throw new RuntimeException("Attempt to commit before opening a transaction");
        }
        // For transaction started internally by repl load command, heartbeat needs to be stopped.
        clearLocksAndHB();
      }
      getMS().commitTxn(rqst);
    } catch (NoSuchTxnException e) {
      LOG.error("Metastore could not find " + JavaUtils.txnIdToString(rqst.getTxnid()));
      throw new LockException(e, ErrorMsg.TXN_NO_SUCH_TRANSACTION, JavaUtils.txnIdToString(rqst.getTxnid()));
    } catch (TxnAbortedException e) {
      LockException le = new LockException(e, ErrorMsg.TXN_ABORTED,
              JavaUtils.txnIdToString(rqst.getTxnid()), e.getMessage());
      LOG.error(le.getMessage());
      throw le;
    } catch (TException e) {
      throw new LockException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(), e);
    } finally {
      if (rqst.isSetReplLastIdInfo()) {
        // For transaction started internally by repl load command, needs to clear the txn info.
        resetTxnInfo();
      }
    }
  }
@param delay time to delay for first heartbeat
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java