Hi there,

I have been slowly building up my cluster policies to re-produce the rules
we set on our collections when they are created *(pre v7)*. One of these
rules was rack awareness, which I've implemented by the following:

{
  "replica": "#EQUAL",
  "shard": "#EACH",
  "sysprop.racklocation": "#EACH"
}

Whilst this works and shows valid violations as shown below:

"collection":"collection_name",
"shard":"shard2",
"tagKey":"/rack/001",
"violation":{
  "replica":{
    "NRT":2,
    "count":2},
  "delta":1.0},
"clause":{
  "replica":"#EQUAL",
  "shard":"#EACH",
  "sysprop.racklocation":"#EACH",
  "collection":"collection_name"},
"violatingReplicas":[{
    "core_node45":{
      "core":"collection_name_shard2_replica3",
      "shard":"shard2",
      "collection":"collection_name",
      "node_name":"127.0.0.1:8080_solr",
      "type":"NRT",
      "base_url":"http://127.0.0.1:8080/solr";,
      "state":"active",
      "force_set_state":"false",
      "INDEX.sizeInGB":12.280795318074524}}
,{
    "core_node2":{
      "core":"collection_name_shard2_replica1",
      "shard":"shard2",
      "collection":"collection_name",
      "node_name":"127.0.0.2:8083_solr",
      "type":"NRT",
      "leader":"true",
      "base_url":"http://127.0.0.2:8083/solr";,
      "state":"active",
      "force_set_state":"false",
      "INDEX.sizeInGB":12.24499356560409}}]},

As you can see there are two replicas which are on rack "rack/001" which
isn't allowed. However when going onto the /autoscaling/suggestions
endpoint, nothing is returned:
{
"responseHeader":{
"status":0,
"QTime":43848},
"suggestions":[],
"WARNING":"This response format is experimental. It is likely to change in
the future."}

I experimented by explicitly stating the racks that are present in the
cluster, i.e.
{
  "replica": "#EQUAL",
  "shard": "#EACH",
  "sysprop.racklocation": ["/rack/001", "/rack/002", "/rack/003",
"/rack/004"]
}

With hopes that Solr would be able to use this to deduce where to place
violating replicas, however, this still doesn't work.

I was wondering if anyone had any similar experience with using system
properties for cluster policies, and how it affects the suggestions
endpoint, as I'm having difficulty of getting results from this.

Cheers,
Richard Goodman

Reply via email to