protected void verifyThisReplicaIsActive(SolrCore solrCore) throws SolrException {
        String replicaState = "unknown";
        String nodeName = "?";
        String shardName = "?";
        String collectionName = "?";
        String role = "?";
        Exception exc = null;
        try {
            CoreDescriptor coreDescriptor = solrCore.getCoreDescriptor();
            CoreContainer coreContainer = coreDescriptor.getCoreContainer();
            CloudDescriptor cloud = coreDescriptor.getCloudDescriptor();

            shardName = cloud.getShardId();
            collectionName = cloud.getCollectionName();
            role = (cloud.isLeader() ? "Leader" : "Replica");

            ZkController zkController = coreContainer.getZkController();
            if (zkController != null) {
                nodeName = zkController.getNodeName();
                if (zkController.isConnected()) {
                    ClusterState clusterState = zkController.getClusterState();
                    Slice slice = clusterState.getSlice(collectionName, shardName);
                    replicaState = (slice != null) ? slice.getState() : "gone";
                } else {
                    replicaState = "not connected to Zookeeper";
                }
            } else {
                replicaState = "Zookeeper not enabled/configured";
            }
        } catch (Exception e) {
            replicaState = "error determining cluster state";
            exc = e;
        }

        if ("active".equals(replicaState)) {
            log.info(String.format("%s at %s for %s in the %s collection is active.",
                    role, nodeName, shardName, collectionName));
        } else {
            // fail the ping by raising an exception
            String errMsg = String.format("%s at %s for %s in the %s collection is not active! State is: %s",
                    role, nodeName, shardName, collectionName, replicaState);
            if (exc != null) {
                throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, errMsg, exc);
            } else {
                throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, errMsg);
            }
        }
    }