Solr
  1. Solr
  2. SOLR-4051

DIH Delta updates do not work for all locales

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      DIH Writes the last modified date to a Properties file using the default locale. This gets sent in plaintext to the database at the next delta update. DIH does not use prepared statements but just puts the date in an SQL Statement in yyyy-mm-dd hh:mm:ss format. It would probably be best to always format this date in JDBC escape syntax (http://docs.oracle.com/javase/1.4.2/docs/guide/jdbc/getstart/statement.html#999472) and java.sql.Timestamp#toString(). To do this, we'd need to parse the user's query and remove the single quotes likely there (and now the quotes would be optional and undesired).

      It might just be simpler to change the SimpleDateFormat to use the root locale as this appears to be the original intent here anyhow. Affected locales include ja_JP_JP , hi_IN , th_TH

      1. SOLR-4051.patch
        103 kB
        James Dyer
      2. SOLR-4051.patch
        30 kB
        James Dyer

        Issue Links

          Activity

          Hide
          James Dyer added a comment -

          found while investigating delta failures with SOLR-3856.

          Show
          James Dyer added a comment - found while investigating delta failures with SOLR-3856 .
          Hide
          James Dyer added a comment -

          This also fixes SOLR-1970 & SOLR-2658, allowing configurable locale, dateformat, filename and location. It needs a new test and validation.

          This adds a <propertyWriter /> as an element in data-config.xml that allows the user to specify an implementation of interface DIHPropertiesWriter. This interface was introduced in 3.6 and should have been marked as "lucene.experimental". This patch changes this interface and adds the experimental annotation also, just in case it needs to change again.

          Allowing pluggable property writers should open the door to easily solve issues like SOLR-3365.

          Show
          James Dyer added a comment - This also fixes SOLR-1970 & SOLR-2658 , allowing configurable locale, dateformat, filename and location. It needs a new test and validation. This adds a <propertyWriter /> as an element in data-config.xml that allows the user to specify an implementation of interface DIHPropertiesWriter. This interface was introduced in 3.6 and should have been marked as "lucene.experimental". This patch changes this interface and adds the experimental annotation also, just in case it needs to change again. Allowing pluggable property writers should open the door to easily solve issues like SOLR-3365 .
          Hide
          James Dyer added a comment -

          Improved patch with a unit test. I plan on committing this shortly.

          Show
          James Dyer added a comment - Improved patch with a unit test. I plan on committing this shortly.
          Hide
          James Dyer added a comment -

          committed.

          Trunk: r1408873 / r1408880 (CHANGES.txt)
          4x: r1408883

          I will also update the wiki.

          Show
          James Dyer added a comment - committed. Trunk: r1408873 / r1408880 (CHANGES.txt) 4x: r1408883 I will also update the wiki.
          Hide
          Commit Tag Bot added a comment -
          Show
          Commit Tag Bot added a comment - [branch_4x commit] James Dyer http://svn.apache.org/viewvc?view=revision&revision=1408884 SOLR-4051 : fix typo
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] James Dyer
          http://svn.apache.org/viewvc?view=revision&revision=1408883

          SOLR-4051: Configurable DIH Property Writers

          Show
          Commit Tag Bot added a comment - [branch_4x commit] James Dyer http://svn.apache.org/viewvc?view=revision&revision=1408883 SOLR-4051 : Configurable DIH Property Writers

            People

            • Assignee:
              James Dyer
              Reporter:
              James Dyer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development