code: static long checkTransactionId(long currentTransactionId, FSEditLogOp op)
        throws IOException {
      if (currentTransactionId != -1) {
        if (op.getTransactionId() != currentTransactionId + 1) {
          LOG.error("Read invalid txId=" + op.getTransactionId()
              + " expectedTxId=" + (currentTransactionId + 1) + ":" +  op);
          throw new IOException("checkTransactionId failed");
        }
      }
      currentTransactionId = op.getTransactionId();
      return currentTransactionId;
    }
docs: Asserts the read operation is the expected one.
  @param op the newly read operation
  @param expectedTransactionId
  @return next expected transaction id
  @throws IOException if the transaction id doesn't match the expected
  transaction id. The transaction id's should be consecutive.