1

Our custom indexes have primary (search_index) and Secondary (search_index_rebuild) cores which are pointing differently in master and slave servers as we are using SwitchOnRebuildSolrSearchIndex. Due to this mismatch, some of the products are not coming in the live site if those products are only present in one of the custom index cores.

Example: if any product is present only in one of the custom indexes core such as in Master SOLR Server the product is present only in search_index (Primary core) and search_index is pointing to search_index_rebuild core then the product is coming in the search result.

In the SOLR slave server, the search_index is also pointing to the search_index_rebuild instance but giving a different document count/ Last Modified date which is not providing the product result

ex: Master server: search_index (20k doc) & search_index_rebuild(10k)
Solr slave server: search_index (10k doc) & search_index_rebuild(20k)

Version:

Solr version: 7.2.1

Sitecore version: 9.1.0

Please let us know how we can resolve this or adjust this SwitchOnRebuildSolrSearchIndex functionality for our SOLR Master-Slave setup so that it will always provide us the same results.

We don't want to use SolrCloud.

enter image description here

search_index solrconfig.xml in Slave server:

enter image description here

search_index_rebuild solrconfig.xml in Slave server: enter image description here

Master server search_index and search_index_rebuild:

enter image description here

enter image description here

Slave server search_index and search_index_rebuild: enter image description here

enter image description here

1 Answer 1

0

When a core rebuild is initiated and you have SwitchOnRebuildSolrSearchIndex configured, the non active core is used to rebuild the index. When the rebuild is completed a swap command is sent to solr, after which each core will be known by the name of the other, after the swap.

You can trigger this manually via solr dashboards using command below:

admin/cores?action=SWAP&core=core-name&other=other-core-name

This command effectively updates the core.properties file with a latest update date and also changes (i.e. after first rebuild on search_index):

name=search_index_rebuid

If you have master/slave configured correctly in solr, then the changes mentioned above should then be exactly mirrored to the slave solr role.

Please check on your solr servers what is shown in core.properties (name=) for both main and rebuild cores, then compare to compare this matches on slave.

Also please check that both CA and CD sitecore roles have the same SwitchOnRebuildSolrSearchIndex config. I'm wondering if maybe CD has original (non switch) and could maybe just always point to search_index even if not the latest.

Useful references: https://soyouwannasolrandsitecore.wordpress.com/2020/04/07/finding-the-active-solr-core/

https://doc.sitecore.com/xp/en/developers/90/platform-administration-and-architecture/switch-solr-indexes.html

https://solr.apache.org/guide/6_6/coreadmin-api.html

9
  • The main issue is SwitchOnREbuildSolrSearchIndex is doing the swap but whenever in Master server the search_index points to the search_index_rebuild and in Slave server if we have exactly same index pointing (ie. search_index points to search_index_rebuild) then search_index in slave shows the different number of records (which are present of search_index_rebuild in master). May 2, 2023 at 11:59
  • For example: 20k docs are present when search_index is pointing to search_index_rebuild and 10k docs are present search_index_rebuild when it is pointing to search_index after swap in Master server. But in slave server after index replication 10k docs are present when search_index is pointing to search_index_rebuild data folder and 10k docs are present in search_index_rebuild when it is pointing to search_index. Even after swap index datadir pointing is same in both Master Slave servers but still slave search_index is showing different results than Master May 2, 2023 at 12:31
  • Can you share the replication section within your solrconfig.xml? Specifically look to confirm <str name="masterUrl">your-domain-name.com:8983/solr/${solr.core.name}</str> May 2, 2023 at 12:53
  • @DeanOBien Please check the below link for configuration details: sitecore.stackexchange.com/questions/34235/… May 2, 2023 at 13:42
  • @DeanOBien I have attached the screenshot of solrconfig.xml of replication section in the post. Please find the SwitchOnRebuildSolrSearchIndex config screenshot as well. May 2, 2023 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.