private void checkBeforeDropTopicInternal(String topicName) throws SubscriptionException {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug(
          "Check before dropping topic: {}, topic exists: {}",
          topicName,
          isTopicExisted(topicName));
    }

    TopicMeta topicMeta = topicMetaKeeper.getTopicMeta(topicName);
    if (Objects.isNull(topicMeta)) {
      // DO NOTHING HERE!
      // No matter whether the topic exists, we allow the drop operation
      // executed on all nodes to ensure the consistency.
      return;
    } else {
      if (!consumerGroupMetaKeeper.isTopicSubscribedByConsumerGroup(topicName)) {
        return;
      }
    }

    final String exceptionMessage =
        String.format(
            "Failed to drop topic %s, the topic is subscribed by some consumers",
            topicMeta.getTopicName());
    LOGGER.warn(exceptionMessage);
    throw new SubscriptionException(exceptionMessage);
  }
Caller should ensure that the method is called in the lock {@link #acquireWriteLock}.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/subscription/SubscriptionInfo.java