@Override
  @RetrySemantics.CannotRetry
  public void setCleanerRetryRetentionTimeOnError(CompactionInfo info) throws MetaException {
    if (info.isAbortedTxnCleanup() && info.id == 0) {
      /*
       * MUTEX_KEY.CompactionScheduler lock ensures that there is only 1 entry in
       * Initiated/Working state for any resource.  This ensures that we don't run concurrent
       * compactions for any resource.
       */
      try (TxnStore.MutexAPI.LockHandle ignored = getMutexAPI().acquireLock(MUTEX_KEY.CompactionScheduler.name())) {
        long id = new GenerateCompactionQueueIdFunction().execute(jdbcResource);
        int updCnt = jdbcResource.execute(
            "INSERT INTO \"COMPACTION_QUEUE\" (\"CQ_ID\", \"CQ_DATABASE\", \"CQ_TABLE\", \"CQ_PARTITION\", " +
                " \"CQ_TYPE\", \"CQ_STATE\", \"CQ_RETRY_RETENTION\", \"CQ_ERROR_MESSAGE\", \"CQ_COMMIT_TIME\") " +
                " VALUES (:id, :db, :table, :partition, :type, :state, :retention, :msg, " + getEpochFn(dbProduct) + ")",
            new MapSqlParameterSource()
                .addValue("id", id)
                .addValue("db", info.dbname)
                .addValue("table", info.tableName)
                .addValue("partition", info.partName, Types.VARCHAR)
                .addValue("type", Character.toString(thriftCompactionType2DbType(info.type)))
                .addValue("state", Character.toString(info.state))
                .addValue("retention", info.retryRetention)
                .addValue("msg", info.errorMessage), null);
        if (updCnt == 0) {
          LOG.error("Unable to update/insert compaction queue record: {}. updCnt={}", info, updCnt);
          throw new MetaException("Unable to insert abort retry entry into COMPACTION QUEUE: " +
              " CQ_DATABASE=" + info.dbname + ", CQ_TABLE=" + info.tableName + ", CQ_PARTITION" + info.partName);
        }
      } catch (Exception e) {
        throw new MetaException("Failed to set retry retention time for compaction item: " + info + " Error: " + e);
      }
    } else {
      jdbcResource.execute(
          "UPDATE \"COMPACTION_QUEUE\" SET \"CQ_RETRY_RETENTION\" = :retention, \"CQ_ERROR_MESSAGE\"= :msg WHERE \"CQ_ID\" = :id",
          new MapSqlParameterSource()
              .addValue("retention", info.retryRetention)
              .addValue("msg", info.errorMessage)
              .addValue("id", info.id),
          ParameterizedCommand.EXACTLY_ONE_ROW);
    }
  }
Mark a compaction as refused (to run).
@param info compaction job.
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java