@Override
  public void activateSchemaTemplate(
      final IActivateTemplateInClusterPlan plan, final Template template) throws MetadataException {
    if (!regionStatistics.isAllowToCreateNewSeries()) {
      throw new SeriesOverflowException(
          regionStatistics.getGlobalMemoryUsage(), regionStatistics.getGlobalSeriesNumber());
    }

    plan.setAligned(template.isDirectAligned());
    getDeviceNodeWithAutoCreate(plan.getActivatePath());

    mTree.activateTemplate(plan.getActivatePath(), template);
    writeToMLog(plan);
  }
remove the node from the tag inverted index
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java