private RegionStatus createRegion(RegionConfiguration configuration) {
    // Get a distributed lock
    DistributedMemberLock dml = getDistributedLock();
    if (cache.getLogger().fineEnabled()) {
      cache.getLogger().fine(this + ": Attempting to lock " + dml);
    }
    long start = 0, end;
    RegionStatus status;
    try {
      if (cache.getLogger().fineEnabled()) {
        start = System.currentTimeMillis();
      }
      // Obtain a lock on the distributed lock
      dml.lockInterruptibly();
      if (cache.getLogger().fineEnabled()) {
        end = System.currentTimeMillis();
        cache.getLogger()
            .fine(this + ": Obtained lock on " + dml + " in " + (end - start) + " ms");
      }

      // Attempt to get the region again after the lock has been obtained
      String regionName = configuration.getRegionName();
      Region region = cache.getRegion(regionName);

      // If it exists now, validate it.
      // Else put an entry into the sessionRegionConfigurationsRegion
      // while holding the lock. This will create the region in all VMs.
      if (region == null) {
        regionConfigurationsRegion.put(regionName, configuration);

        // Retrieve the region after creating it
        region = cache.getRegion(regionName);
        // If the region is null now, it wasn't created for some reason
        // (e.g. the region attributes id were invalid)
        if (region == null) {
          status = RegionStatus.INVALID;
        } else {
          // Create the PR buckets if necessary)
          if (region instanceof PartitionedRegion) {
            PartitionedRegion pr = (PartitionedRegion) region;
            createBuckets(pr);
          }
          status = RegionStatus.VALID;
        }
      } else {
        status = RegionStatus.VALID;
        try {
          RegionHelper.validateRegion(cache, configuration, region);
        } catch (Exception e) {
          if (!e.getMessage()
              .equals("CacheListeners are not the same")) {
            cache.getLogger().warning(e);
          }
          status = RegionStatus.INVALID;
        }
      }
    } catch (Exception e) {
      String builder = this + ": Caught Exception attempting to create region named "
          + configuration.getRegionName() + ":";
      cache.getLogger().warning(builder, e);
      status = RegionStatus.INVALID;
    } finally {
      // Unlock the distributed lock
      try {
        dml.unlock();
      } catch (Exception ignore) {
      }
    }
    return status;
  }
If the existing region was using the DEFAULT diskstore but it was not explicitly linked to the
region using setDiskStore or disk-store-name tags. diskStoreName is set as null. This is
interpreted by Geode as use the DEFAULT diskstore.
This link between the existing region and a diskstore may happen because the diskstore is
named as DEFAULT.
The user may change the default location of the DEFAULT diskstore but the AppServer always
requests it be at the default location.
This comparison with always used to fail and the AppServer could not start up.
The goal of this method is that if both existing region and requested region are using the
DEFAULT diskstore, the existing regions take precedence and the requested ones are ignored.
This is current behavior which can be seen in
{@link RegionAttributesCreation#sameAs(RegionAttributes)}
The logic is to intercept the configurations for the regions and only if the both the regions
have diskStoreName set to null, meaning both should use the DEFAULT diskstore, the diskstore
names are sent as DEFAULT in the configuration and send to geode-core for comparison for rest
of the region attributes.
extensions/geode-modules/src/main/java/org/apache/geode/modules/util/CreateRegionFunction.java