Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4455

Stored value of "NOW" differs between replicas

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.1
    • None
    • update
    • None

    Description

      I have a field in schema.xml defined like this:

      <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" />
      

      When I perform a query that's load-balanced across the servers in my cloud, the value stored in that field differs slightly between each replica for the same returned document.

      I haven't seen this field differ by more than a tenth of a second and I'm not running queries against it, but I can picture a situation where somebody has one replica returning 23:59:59.990 and another returning 00:00:00.010 and a query starts behaving oddly.

      It seems like the leader should evaluate what "NOW" means and the replicas should copy that value.

      Possible Workaround

      A possible workaround for this issue is to use the TimestampUpdateProcessorFactory in your update processor chain prior to the DistributedUpdateProcessor instead of relying on the using "NOW" as a default value for date fields.

      This will cause the timestamp field of each document to be filled in with a value before the documents are forwarded to any shards (or written to the transaction log)

      https://lucene.apache.org/solr/4_1_0/solr-core/org/apache/solr/update/processor/TimestampUpdateProcessorFactory.html

      Attachments

        1. SOLR-4455.patch
          18 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              cbartolo Colin Bartolome
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: