private void createDatabase(ConfigNodeProcedureEnv env, int id) throws ProcedureException {
    String databaseName = DATABASE_NAME_PREFIX + id;
    TSStatus status = ProcedureTestUtils.createDatabase(env.getConfigManager(), databaseName);
    if (TSStatusCode.DATABASE_ALREADY_EXISTS.getStatusCode() == status.getCode()) {
      // First mistakes are forgivable, but a second signals a problem.
      if (!createFailedOnce) {
        createFailedOnce = true;
      } else {
        throw new ProcedureException("createDatabase fail twice");
      }
    } else if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != status.getCode()) {
      throw new ProcedureException("Unexpected fail, tsStatus is " + status);
    }
  }
This procedure will create numerous databases (perhaps 100), during which the confignode leader
should be externally shutdown to test whether the procedure can be correctly recovered after the
leader change. The procedure will never finish until it's recovered from another ConfigNode.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/testonly/CreateManyDatabasesProcedure.java