public synchronized boolean decreaseReferenceCount(
      final String holderMessage, final boolean shouldReport) {
    boolean isSuccessful = true;

    if (isReleased.get()) {
      LOGGER.warn(
          "decrease reference count to event that has already been released: {}, stack trace: {}",
          coreReportMessage(),
          Thread.currentThread().getStackTrace());
      isSuccessful = false;
      return isSuccessful;
    }

    if (referenceCount.get() == 1) {
      // We assume that this function will not throw any exceptions.
      if (!internallyDecreaseResourceReferenceCount(holderMessage)) {
        LOGGER.warn(
            "resource reference count is decreased to 0, but failed to release the resource, EnrichedEvent: {}, stack trace: {}",
            coreReportMessage(),
            Thread.currentThread().getStackTrace());
      }
      if (!shouldReport) {
        shouldReportOnCommit = false;
      }
      PipeEventCommitManager.getInstance().commit(this, committerKey);
    }

    // No matter whether the resource is released, we should decrease the reference count.
    final int newReferenceCount = referenceCount.decrementAndGet();
    if (newReferenceCount <= 0) {
      isReleased.set(true);
      isSuccessful = newReferenceCount == 0;
      if (newReferenceCount < 0) {
        LOGGER.warn(
            "reference count is decreased to {}, event: {}, stack trace: {}",
            newReferenceCount,
            coreReportMessage(),
            Thread.currentThread().getStackTrace());
        referenceCount.set(0);
      }
    }

    if (!isSuccessful) {
      LOGGER.warn(
          "decrease reference count failed, EnrichedEvent: {}, stack trace: {}",
          coreReportMessage(),
          Thread.currentThread().getStackTrace());
    }
    return isSuccessful;
  }
Decrease the {@link EnrichedEvent#referenceCount} of this {@link EnrichedEvent} by 1. If the
{@link EnrichedEvent#referenceCount} is decreased to 0, the {@link EnrichedEvent} can be
recycled and the data stored in the {@link EnrichedEvent} is not safe to use, the processing
{@link ProgressIndex} of the event should be reported to the {@link PipeTaskMeta}.

@param holderMessage the message of the invoker
@return {@code true} if the {@link EnrichedEvent#referenceCount} is decreased successfully,
    {@code false} otherwise
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/event/EnrichedEvent.java