private void removePrimaryMetadata() {
    Region region = cache.getRegion(PartitionedRegionName);
    ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
    cms.getClientPRMetadata((LocalRegion) region);

    final Map<String, ClientPartitionAdvisor> regionMetaData = cms.getClientPRMetadata_TEST_ONLY();

    final ClientPartitionAdvisor prMetaData = regionMetaData.get(region.getFullPath());
    Map<Integer, List<BucketServerLocation66>> bucketLocations =
        prMetaData.getBucketServerLocationsMap_TEST_ONLY();
    for (Map.Entry<Integer, List<BucketServerLocation66>> locationEntry : bucketLocations
        .entrySet()) {
      List<BucketServerLocation66> newList = new ArrayList<>(locationEntry.getValue());
      for (Iterator<BucketServerLocation66> bucketIterator = newList.iterator(); bucketIterator
          .hasNext();) {
        BucketServerLocation66 location = bucketIterator.next();
        if (location.isPrimary()) {
          bucketIterator.remove();
        }
        bucketLocations.put(locationEntry.getKey(), newList);
      }

    }
  }
If a client doesn't know the primary location of a bucket it should perform a
metadata refresh. This test purposefully removes all primary location knowledge
from PR metadata in a client cache and then performs a bulk operation. This
should trigger a refresh.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java