You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Markus Jelsma <ma...@openindex.io> on 2017/04/14 15:25:25 UTC

CloudDescriptor.getNumShards() sometimes returns null

Hi - I've got this 2 shard/2 replica cluster. In handler i need the number of shards of the cluster.

        cloudDescriptor = core.getCoreDescriptor().getCloudDescriptor();
        return cloudDescriptor.getNumShards();

It is, however, depending on which node is executing this, sometimes null! This code only runs on shard leaders. First replica of the first shard always returns 2, but second replica of shard one, even when it is the leader, always gets me null. Same appears to be true for the second shard.

I am clearly missing something, any ideas to share?

Thanks,
Markus