1

Environment

Sitecore 8.0 Update 5 (with patches applied)

Lucene indexes

Severs: CM, CD1, CD2

Publish targets: web, end-user

on the CM server the connectionStrings are:

<add name="web" connectionString="...Database=..._web" />
<add name="end-user" connectionString="...Database=..._public_web" />

on the CD servers the connectionStrings are:

<add name="web" connectionString="...Database=..._public_web" />
<add name="end-user" connectionString="...Database=..._public_web" />

Issue

When I publish an item it does not appear in the CD servers index.

Details

The index is defined with the following:

<indexes hint="list:AddIndex">
    <index id="foo_index" type="Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex, Sitecore.ContentSearch.LuceneProvider">
        <param desc="name">$(id)</param>
        <param desc="folder">$(id)</param>
        <!-- This initializes index property store. Id has to be set to the index id -->
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/NorthwesternBreakthroughsIndexConfiguration" />
        <!-- Points to my custom SearchConfiguration node -->
        <strategies hint="list:AddStrategy">
            <!-- NOTE: order of these is controls the execution order -->
            <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
            <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/remoteRebuild" />
        </strategies>
        <locations hint="list:AddCrawler">
            <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
                <Database>web</Database>
                <Root>/sitecore/content/Foo/Bar/</Root>
            </crawler>
        </locations>
    </index>
</indexes>

EventQueues are enabled:

<setting name="EnableEventQueues" value="true" />

When the relevant content item is published it appears as expected on the CM server.

The following appears in the CM server log:

ManagedPoolThread #2 08:22:14 INFO  Job started: Index_Update_IndexName=foo_index
ManagedPoolThread #2 08:22:14 INFO  Job ended: Index_Update_IndexName=foo_index(units processed: )

The following entry is added to the target database EventQueue table:

Id    EventType    InstanceName    Created
FB3EE257-DC1C-4A85-A33C-EA6AD6D6A833    Sitecore.Data.Eventing.Remote.SavedItemRemoteEvent, Sitecore.Kernel, Version=8.0.5245.0, Culture=neutral, PublicKeyToken=null    sc8CM1    2020-03-23 13:22:14.487
A7A535D8-DA7F-4CA0-A1D7-65F063C713DC    Sitecore.Eventing.Remote.PublishEndRemoteEvent, Sitecore.Kernel, Version=8.0.5245.0, Culture=neutral, PublicKeyToken=null    sc8CM1    2020-03-23 13:22:17.300

I published the item at 8:22 AM. The Created column though reads 13:22 which I assume to be UTC time.

The master database Properties table shows the following also in UTC time:

ID  Key Value
34611E4E-3C09-4A87-9DF0-6DD8CFAC960B    IndexingProvider_LastUpdate_sc8CM1  20200323T132136Z
A5F073C7-1D95-49B0-82EA-4584E0D1A34C    IndexingProvider_LastUpdate_sc8CD1  20200323T132318Z
B50B7369-8269-49D1-AA9E-5FFBEF7A9C82    IndexingProvider_LastUpdate_sc8CD2  20200323T132523Z

master database History table:

Id  Category    Action  ItemId  Created
71E7E059-23A8-421D-A504-F2E669DCBA43    Item    Saved   E7ED8CD4-0687-4C51-AB54-CA6F5BD45249    2020-03-23 13:21:35.253

web database has a corresponding entry

All three servers are configured for Central Standard Time and the corresponding Sitecore setting reads:

<!--  SERVER TIME ZONE
    This setting specifies the server time zone that is used by the server to convert UTC time to local time, for example "GMT Standard Time".
    The value must be parsable to a valid Time Zone ID. See http://msdn.microsoft.com/en-us/library/gg154758.aspx
    If blank, Sitecore uses the operating system time zone.
    Default value: "" (use the operating system time zone)
-->
<setting name="ServerTimeZone" value="" />

Scalability settings are also configured properly for each server:

CM

<setting name="InstanceName">
    <patch:attribute name="value">sc8CM1</patch:attribute>
</setting>

<setting name="Publishing.PublishingInstance">
    <patch:attribute name="value">sc8CM1</patch:attribute>
</setting>

CD1

<setting name="InstanceName">
    <patch:attribute name="value">sc8CD1</patch:attribute>
</setting>

<setting name="Publishing.PublishingInstance">
    <patch:attribute name="value">sc8CM1</patch:attribute>
</setting>

CD2

<setting name="InstanceName">
    <patch:attribute name="value">sc8CD2</patch:attribute>
</setting>

<setting name="Publishing.PublishingInstance">
    <patch:attribute name="value">sc8CM1</patch:attribute>
</setting>

The CD server log shows the expected registrations:

Line 1: 2668 08:29:40 INFO  [Index=foo_index] Initializing OnPublishEndAsynchronousStrategy.
Line 2: 2668 08:29:40 INFO  [Index=foo_index] Initializing RemoteRebuildStrategy.
Line 3: 2668 08:29:40 INFO  [Index=foo_index] Initializing SitecoreItemCrawler. DB:web / Root:/sitecore/content/Foo/Bar/

I have also confirmed that the appropriate permissions have been applied to the Website and Data folders on each server.

Rebuilding the index from the control panel does nothing but rebuilding the index from the Developer tab in the content tree does force the CD servers to show the expected content. This is just masking the problem though...

I had a suspicion that there might have been a bug related to the UTC time being used instead of the current server time but after waiting 5 hours for the local time to match the index timestamp it still did not update on its own, even with a restart of the AppPool.

I also followed the suggestion here but to no avail. When I published another modification the following inconsistency appears in the Properties table:

enter image description here enter image description here

At this point I am at a loss to what could be missing. Something trivial? Something worse? Any assistance is of course appreciated

  • I recommend you to use Solr instead of Lucene. Is not recommended to use Lucene in a scaled environment. Please have a look on this article : doc.sitecore.com/developers/82/sitecore-experience-platform/en/… – Vlad Iobagiu Mar 23 at 21:03
  • 1
    @VladIobagiu While that promises to remove the cause, it doesn't cure the symptom. A Solr migration and upgrade to a newer version of Sitecore is non-trivial. These are also already on our roadmap but the milestones are not close. – mlhaufe Mar 23 at 21:22
  • It seems that you have only uploaded the lucene index config from CD which is pointing towards web db. And that looks fine. Can you please upload the lucene config from CM which points to master db? – Somnath Dutta Mar 25 at 10:29
1

Given the details in the above questions, the only thing I found missing, is the Lucene config for master index. I am also running a platform on Sitecore 8.2.2 with Lucene and in a setup similar to yours (1 CM and 2 CDs). My lucene index for Master DB looks like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
 <sitecore>
<contentSearch>
  <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
    <indexes hint="list:AddIndex">

      <index id="sitecore_foo_master_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
        <param desc="name">$(id)</param>
        <param desc="folder">$(id)</param>
        <!-- This initializes index property store. Id has to be set to the index id -->
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
        <strategies hint="list:AddStrategy">
          <!-- NOTE: order of these is controls the execution order -->
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster" />
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/remoteRebuild" />

        </strategies>
        <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
          <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
          </policies>
        </commitPolicyExecutor>
        <locations hint="list:AddCrawler">
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>master</Database>
            <Root>/sitecore/content/FooSite</Root>
          </crawler>
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>master</Database>
            <Root>/sitecore/media library/FooSite</Root>
          </crawler>              
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>

    </indexes>
  </configuration>
</contentSearch>

The only difference between your config and the one here is, I am not using SwitchOnRebuildIndexes like in your case. I have noticed that you do not have any commit policy executor defined in your Lucene config for Web(given above). Please consider using something like this:

<commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
          <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.ModificationCountCommitPolicy, Sitecore.ContentSearch">
              <Limit>300</Limit>
            </policy>
            </policies>
        </commitPolicyExecutor>

I hope this helps resolve the issue.

| improve this answer | |
  • Thanks, I noticed the <commitPolicyExecutor /> issue right after I posted. Adding this node made no difference though. The following sitecore article seems to do the trick <kb.sitecore.net/articles/992608>. I'm not completely certain why, but from looking at the code in dotPeek it seems to be a bug with the EventQueue and the default Threshold value? Just a guess, but you've helped enough to put me on the right track for a good-enough solution until we can complete an upgrade. – mlhaufe Mar 31 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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