apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
242 stars 112 forks source link

Support replicaPlacementFactory in solr.xml #691

Open janhoy opened 3 months ago

janhoy commented 3 months ago

With https://issues.apache.org/jira/browse/SOLR-15782 in 9.5, we got support for configuring placement plugins in solr.xml:

<replicaPlacementFactory class="org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory">
  <int name="minimalFreeDiskGB">10</int>
  <int name="prioritizedFreeDiskGB">200</int>
</replicaPlacementFactory>

The operator could support a similar configuration option. Perhaps it can be made generic:

replicaPlacementFactory:
  class: org.apache.solr.cluster.placement.plugins.AffinityPlacementFactory
  config:
    minimalFreeDiskGB: 10
    prioritizedFreeDiskGB: 200

I think we could add support for it before the minimum version is 9.5, since if the user does not configure the feature, nothing will be added to solr.xml. This can be documented.

HoustonPutman commented 3 months ago

I really wish that Solr accepted "additions" to the solr.xml. So a user could provide extra settings that would "override" the default solr.xml. That way they wouldn't have to maintain an entire solr.xml just to provide a replicaPlacementFactory.

dsmiley commented 3 months ago

"additions" -- not the word that comes to mind; I think of "overlay" or "override". I raised this topic on the dev list for solrconfig.xml in 2021 and also mentioned solr.xml too https://lists.apache.org/thread/nf2vgoqpdl5o718hovvq7xnppcp6j37m