<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Solr Sharding DB_ID_RANGE and High Availability in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496685#M40777</link>
    <description>&lt;P&gt;After debugging the source code, I think the dynamic shard registry has been removed from Alfresco Community Edition. At&amp;nbsp;query time, alfresco apparently instantiates always the &lt;STRONG&gt;&lt;EM&gt;ExplicitSolrStoreMappingWrapper&lt;/EM&gt;&lt;/STRONG&gt; instead of the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;DynamicSolrStoreMappingWrapper&lt;/STRONG&gt;. &lt;/EM&gt;At least with DB_ID_RANGE sharding.&amp;nbsp;That happens even if you have &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;explicitly&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; enabled the dynamic registry (&lt;STRONG&gt;&lt;EM&gt;solr.useDynamicShardRegistration=true&lt;/EM&gt;&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Istantanea_2026-02-25_16-48-02.png" style="width: 999px;"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/13517i1F92CDF135A65886/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Istantanea_2026-02-25_16-48-02.png" alt="Istantanea_2026-02-25_16-48-02.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That because &lt;EM&gt;shardRegistry&lt;/EM&gt; object is null when alfresco tries to extract and build the Solr mapping by &lt;EM&gt;&lt;STRONG&gt;SolrClientUtil:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;// org.alfresco.repo.search.impl.solr.SolrClientUtil
//
public static SolrStoreMappingWrapper extractMapping(StoreRef store, 
            HashMap&amp;lt;StoreRef, SolrStoreMappingWrapper&amp;gt; mappingLookup, ShardRegistry shardRegistry,
            boolean useDynamicShardRegistration,BeanFactory beanFactory)
    {
	// shardRegistry is  null here !!!
        if((shardRegistry != null) &amp;amp;&amp;amp; useDynamicShardRegistration)
        {
            SearchParameters sp = new SearchParameters();
            ...
            return DynamicSolrStoreMappingWrapperFactory.wrap(slice, beanFactory);
        }
        else
        { 
	       // ok there's another wrapper for you,
            // this is the concrete ExplicitSolrStoreMappingWrapper here
            SolrStoreMappingWrapper mappings = mappingLookup.get(store);
	    ....
            return mappings;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;I think devs have intentionally removed part of shard registry implementation on community edition. I can see a specific &lt;EM&gt;search-enterprise-context.xml&lt;/EM&gt; for the enterprise edition that is missing on community ed.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;bean id="search.solrQueryHTTPCLient" class="org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient" init-method="init"&amp;gt;
...
 &amp;lt;property name="shardRegistry"&amp;gt;
   &amp;lt;ref bean="search.SolrShardRegistry"/&amp;gt;
 &amp;lt;/property&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And this is the implementation in &lt;EM&gt;common-search-enterprise-context.xml&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;bean id="search.solrShardRegistry" class="org.alfresco.repo.index.shard.ShardRegistryImpl" init-method="init"&amp;gt;
 &amp;lt;property name="purgeOnInit"&amp;gt;
   &amp;lt;value&amp;gt;${search.solrShardRegistry.purgeOnInit}&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I think the official documentation should be updated about that&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.hyland.com/r/Alfresco/Alfresco-Search-and-Insight-Engine/2.0/Alfresco-Search-and-Insight-Engine/Configure/Solr-sharding/Dynamic-shard-registration" target="_blank" rel="noopener"&gt;https://support.hyland.com/r/Alfresco/Alfresco-Search-and-Insight-Engine/2.0/Alfresco-Search-and-Insight-Engine/Configure/Solr-sharding/Dynamic-shard-registration&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Feb 2026 09:03:50 GMT</pubDate>
    <dc:creator>joe_l3</dc:creator>
    <dc:date>2026-02-26T09:03:50Z</dc:date>
    <item>
      <title>Solr Sharding DB_ID_RANGE and High Availability</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496584#M40772</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;does&amp;nbsp; high availability work&amp;nbsp; for a Solr sharding with DB_ID_RANGE method ?&lt;/P&gt;&lt;P&gt;I have 3 shards (manually) distributed on 3 Solr nodes with replication factor 2. Here my setup:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Alfresco Content service 7.4.0.1&lt;/LI&gt;&lt;LI&gt;Alfresco Search service : 2.0 with Solr 6&lt;/LI&gt;&lt;LI&gt;Sharding Method: DB_ID_RANGE&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Solr node 1 (port 8181)&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;alfresco-0&lt;/LI&gt;&lt;LI&gt;alfresco-1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Solr node 2 (port 8282)&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;alfresco-1&lt;/LI&gt;&lt;LI&gt;alfresco-2&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Solr node 3 (port 8383)&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;alfresco-0&lt;/LI&gt;&lt;LI&gt;alfresco-2&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Alfresco Content Service (alfresco-global.properties)&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;solr6.store.mappings.value.solrMappingAlfresco.nodeString=solr-host-1:8181/solr/alfresco,solr-host-2:8282/solr/alfresco,solr-host-3:8383/solr/alfresco
solr6.store.mappings.value.solrMappingAlfresco.numShards=3
solr6.store.mappings.value.solrMappingAlfresco.replicationFactor=2&lt;/LI-CODE&gt;&lt;P&gt;Assuming 1000+ ID rows on my DB, I created the 3 shards (and replicas) with the following ID range:&lt;BR /&gt;alfresco-0: 0-400&lt;BR /&gt;alfresco-1: 401-800&lt;BR /&gt;alfresco-2: 801-1200&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;All indexes are working fine, because I individually tested each Solr node with&amp;nbsp; some FTS query directly on Solr Rest API (by their query web console).&amp;nbsp;Alfresco-Share works fine as well and the repository looks as expected.&lt;/P&gt;&lt;P&gt;The issue comes after intentionally stopping a Solr node to test the high availability. Alfresco shows this error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;026-02-23T16:17:34,849 [] ERROR [extensions.webscripts.AbstractRuntime] Failed to execute search: PATH:"/app:company_home//*" AND ASPECT:"{http://www.alfresco.org/model/content/1.0}taggable" 
Caused by: org.alfresco.repo.search.QueryParserException: 01230759
Caused by: java.net.ConnectException: Connection refused
	at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
...
01230037 Solr request failed with 500 /solr/alfresco-2/afts?wt=json&amp;amp;fl=DBID,score&amp;amp;rows=100&amp;amp;shards=http://solr-1:8181/solr/alfresco-0,http://solr-2:8282/solr/alfresco-1,http://solr-3:8383/solr/alfresco-2&amp;amp;df=TEXT&amp;amp;start=0&amp;amp;locale=it&amp;amp;alternativeDic=DEFAULT_DICTIONARY&amp;amp;fq={!afts}AUTHORITY_FILTER_FROM_JSON&amp;amp;fq={!afts}TENANT_FILTER_FROM_JSON&lt;/LI-CODE&gt;&lt;P&gt;Pay attention to the Error 500 Response and look at the "shards" url parameter:&lt;/P&gt;&lt;P&gt;shards=&lt;A href="http://localhost:8181/solr/alfresco-0,http://localhost:8282/solr/alfresco-1,http://localhost:8383/solr/alfresco-2" target="_blank" rel="noopener"&gt;http://localhost:8181/solr/alfresco-0,http://localhost:8282/solr/alfresco-1,http://localhost:8383/solr/alfresco-2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It looks like Alfresco builds a shard chain sequentially alfresco-0,alfresco-1,alfresco-2.&amp;nbsp;Is that an expected behaviour for high availability ?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 09:15:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496584#M40772</guid>
      <dc:creator>joe_l3</dc:creator>
      <dc:date>2026-02-24T09:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Solr Sharding DB_ID_RANGE and High Availability</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496620#M40774</link>
      <description>&lt;P&gt;Yes, what you are seeing is expected.&lt;/P&gt;
&lt;P&gt;In your configuration Alfresco only knows &lt;STRONG&gt;one&lt;/STRONG&gt; Solr endpoint per logical shard, even though you created replicas. When it builds the &lt;CODE&gt;shards=&lt;/CODE&gt; parameter, it selects one URL for each shard (&lt;CODE&gt;alfresco-0&lt;/CODE&gt;, &lt;CODE&gt;alfresco-1&lt;/CODE&gt;, &lt;CODE&gt;alfresco-2&lt;/CODE&gt;). If the node hosting one of those shard instances is down, there is no alternative endpoint for that shard, so the query fails with &lt;CODE&gt;Connection refused&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;Sharding itself does &lt;STRONG&gt;not automatically provide high availability&lt;/STRONG&gt;. HA only works if Alfresco can see and use &lt;STRONG&gt;multiple shard instances per shard&lt;/STRONG&gt; (either via dynamic shard registration or by explicitly configuring all shard-instance endpoints).&lt;/P&gt;
&lt;P&gt;In your current setup, there is no failover for a shard, so the behavior is correct.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 06:50:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496620#M40774</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2026-02-24T06:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Solr Sharding DB_ID_RANGE and High Availability</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496622#M40775</link>
      <description>&lt;P&gt;Hello Angel,&lt;BR /&gt;thanks for your answer.&lt;BR /&gt;What you said makes sense. In other words there's no guarantee you can have HA out-of-the-box with DB_ID_RANGE shard method.&lt;BR /&gt;I have never experienced explicit shard endpoints configuration and the dynamic shard registration didn't help with Alfresco CE + DB_ID_RANGE.&lt;BR /&gt;I tried a minimal dynamic registration (no HA), but it seems only the first specified solr node is registered:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;## alfresco-global.properties
## 
index.subsystem.name=solr6
solr.host=host-1
solr.port=8181

## this should be the DSR trigger on alfresco-side
solr.useDynamicShardRegistration=true
search.solrShardRegistry.purgeOnInit=true
search.solrShardRegistry.shardInstanceTimeoutInSeconds=300
search.solrShardRegistry.dbidRangeRefreshTimeoutInSeconds=30
search.solrShardRegistry.maxAllowedReplicaTxCountDifference=1000

## Solr (host-1:8181)
##
shard.method=DB_ID_RANGE
numShards=3
numNodes=3
nodeInstance=1
shard.range=0-400
shard.instance=0

## Solr (host-2:8282)
##
shard.method=DB_ID_RANGE
numShards=3
numNodes=3
nodeInstance=2
shard.range=401-800
shard.instance=1

## Solr (host-3:8383)
##
shard.method=DB_ID_RANGE
numShards=3
numNodes=3
nodeInstance=3
shard.range=801-1200
shard.instance=2&lt;/LI-CODE&gt;&lt;P&gt;All 3 shards are created succesfully but Alfresco runs queries on Solr host-1 only.&lt;BR /&gt;At the end, it seems the only way to prevent a SPOF with DB_ID_RANGE mode, is by classic external HA solutions like http load balancing, clustering and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 11:24:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496622#M40775</guid>
      <dc:creator>joe_l3</dc:creator>
      <dc:date>2026-02-24T11:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Solr Sharding DB_ID_RANGE and High Availability</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496685#M40777</link>
      <description>&lt;P&gt;After debugging the source code, I think the dynamic shard registry has been removed from Alfresco Community Edition. At&amp;nbsp;query time, alfresco apparently instantiates always the &lt;STRONG&gt;&lt;EM&gt;ExplicitSolrStoreMappingWrapper&lt;/EM&gt;&lt;/STRONG&gt; instead of the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;DynamicSolrStoreMappingWrapper&lt;/STRONG&gt;. &lt;/EM&gt;At least with DB_ID_RANGE sharding.&amp;nbsp;That happens even if you have &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;explicitly&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; enabled the dynamic registry (&lt;STRONG&gt;&lt;EM&gt;solr.useDynamicShardRegistration=true&lt;/EM&gt;&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Istantanea_2026-02-25_16-48-02.png" style="width: 999px;"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/13517i1F92CDF135A65886/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Istantanea_2026-02-25_16-48-02.png" alt="Istantanea_2026-02-25_16-48-02.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That because &lt;EM&gt;shardRegistry&lt;/EM&gt; object is null when alfresco tries to extract and build the Solr mapping by &lt;EM&gt;&lt;STRONG&gt;SolrClientUtil:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;// org.alfresco.repo.search.impl.solr.SolrClientUtil
//
public static SolrStoreMappingWrapper extractMapping(StoreRef store, 
            HashMap&amp;lt;StoreRef, SolrStoreMappingWrapper&amp;gt; mappingLookup, ShardRegistry shardRegistry,
            boolean useDynamicShardRegistration,BeanFactory beanFactory)
    {
	// shardRegistry is  null here !!!
        if((shardRegistry != null) &amp;amp;&amp;amp; useDynamicShardRegistration)
        {
            SearchParameters sp = new SearchParameters();
            ...
            return DynamicSolrStoreMappingWrapperFactory.wrap(slice, beanFactory);
        }
        else
        { 
	       // ok there's another wrapper for you,
            // this is the concrete ExplicitSolrStoreMappingWrapper here
            SolrStoreMappingWrapper mappings = mappingLookup.get(store);
	    ....
            return mappings;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;I think devs have intentionally removed part of shard registry implementation on community edition. I can see a specific &lt;EM&gt;search-enterprise-context.xml&lt;/EM&gt; for the enterprise edition that is missing on community ed.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;bean id="search.solrQueryHTTPCLient" class="org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient" init-method="init"&amp;gt;
...
 &amp;lt;property name="shardRegistry"&amp;gt;
   &amp;lt;ref bean="search.SolrShardRegistry"/&amp;gt;
 &amp;lt;/property&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And this is the implementation in &lt;EM&gt;common-search-enterprise-context.xml&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;bean id="search.solrShardRegistry" class="org.alfresco.repo.index.shard.ShardRegistryImpl" init-method="init"&amp;gt;
 &amp;lt;property name="purgeOnInit"&amp;gt;
   &amp;lt;value&amp;gt;${search.solrShardRegistry.purgeOnInit}&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I think the official documentation should be updated about that&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.hyland.com/r/Alfresco/Alfresco-Search-and-Insight-Engine/2.0/Alfresco-Search-and-Insight-Engine/Configure/Solr-sharding/Dynamic-shard-registration" target="_blank" rel="noopener"&gt;https://support.hyland.com/r/Alfresco/Alfresco-Search-and-Insight-Engine/2.0/Alfresco-Search-and-Insight-Engine/Configure/Solr-sharding/Dynamic-shard-registration&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2026 09:03:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496685#M40777</guid>
      <dc:creator>joe_l3</dc:creator>
      <dc:date>2026-02-26T09:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Solr Sharding DB_ID_RANGE and High Availability</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496798#M40780</link>
      <description>&lt;P&gt;Came back here...&lt;/P&gt;&lt;P&gt;about the &lt;STRONG&gt;HA&lt;/STRONG&gt; which was the initial point of this topic, I didn't find any &lt;STRONG&gt;out-of-the-box&lt;/STRONG&gt; solution able to prevent a singlePointFailure for &lt;STRONG&gt;DB_ID_RANGE&lt;/STRONG&gt; sharding method. The only valid distribution of shards seems to be the creation of every instances on each Solr node. That means:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Solr node 1: shard 0, 1, 2&lt;/LI&gt;&lt;LI&gt;Solr node 2: shard 0, 1, 2&lt;/LI&gt;&lt;LI&gt;Solr node 3: shard 0, 1, 2&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In that case, Alfresco is able to build at query time, the correct Solr chain. Unfortunatellly, in order to refresh the shard registration, you have to force Alfresco restart all the time a Solr node is down.&lt;/P&gt;&lt;P&gt;None of those examples mentioned High Availability part of the official documentation works as expected with DB_ID_RA_NGE shard method.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 14:59:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/solr-sharding-db-id-range-and-high-availability/m-p/496798#M40780</guid>
      <dc:creator>joe_l3</dc:creator>
      <dc:date>2026-03-02T14:59:09Z</dc:date>
    </item>
  </channel>
</rss>

