public InternalDistributedMember waitForPrimary() throws ForceReattemptException {
      try {
        waitForRepliesUninterruptibly();
      } catch (ReplyException e) {
        Throwable t = e.getCause();
        if (t instanceof CancelException) {
          if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) {
            logger.trace(LogMarker.DM_VERBOSE,
                "NodeResponse got remote CacheClosedException, throwing PartitionedRegionCommunication Exception. {}",
                t.getMessage(), t);
          }
          throw new ForceReattemptException(
              "NodeResponse got remote CacheClosedException, throwing PartitionedRegionCommunication Exception.",
              t);
        }
        e.handleCause();
      }
      return msg.getSender();
    }
A processor to capture the member who was selected as primary for the bucket requested

@since GemFire 5.1
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PrimaryRequestMessage.java