private void rollbackPreSetSchemaTemplate(final int templateId, final PartialPath templateSetPath)
      throws MetadataException {
    try {
      treeModelMTree.unsetTemplate(templateId, templateSetPath);
    } catch (final MetadataException ignore) {
      // node not exists or not set template
    }
    templatePreSetTable.removeSetTemplate(templateId, templateSetPath);
  }
Only leader use this interface. Get the maxRegionGroupNum of specified Database.

@param database DatabaseName
@param consensusGroupType SchemaRegion or DataRegion
@return maxSchemaRegionGroupNum or maxDataRegionGroupNum
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java