[
https://issues.apache.org/jira/browse/SOLR-4376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13566321#comment-13566321
]
Sebastien Lorber edited comment on SOLR-4376 at 1/30/13 9:20 AM:
-----------------------------------------------------------------
Exactly.
Basically all these integration tests worked with Solr 1.4, but with Solr 4.1,
the "test_delta_import_when_never_indexed" had to be disabled.
http://pastebin.com/PDnHv2M2
The content of the dataimport.properties file itself is not wrong: it does
contain the dates in the good format. The matter is that when the file doesn't
exist yet, or doesn't contain all regular entries, when requesting a
LAST_INDEX_TIME from this file, there is a fallback to the EPOCH date for
bootstrapping, but the date is added to the map as Date and not as a formatted
String.
The fix could simply be:
{code:java}
indexerNamespace.put(LAST_INDEX_TIME,
getSimplePropertiesWriterDateFormat().format(EPOCH) );
{code}
So that both the persisted date retrieval and a date retrieval miss with
fallback to timestamp=0 will provide the same kind of formatted date to the
indexerNamespace map
was (Author: sebastienlorber):
Exactly.
Basically all these integration tests worked with Solr 1.4, but with Solr 4.1,
the "test_delta_import_when_never_indexed" had to be disabled.
http://pastebin.com/PDnHv2M2
The content of the dataimport.properties file itself is not wrong: it does
contain the dates in the good format. The matter is that when the file doesn't
exist yet, or doesn't contain all regular entries, when requesting a
LAST_INDEX_TIME from this file, there is a fallback to the EPOCH date for
bootstrapping, but the date is added to the map as Date and not as a formatted
String.
The fix could simply be:
indexerNamespace.put(LAST_INDEX_TIME,
getSimplePropertiesWriterDateFormat().format(EPOCH) );
So that both the persisted date retrieval and a date retrieval miss with
fallback to timestamp=0 will provide the same kind of formatted date to the
indexerNamespace map
> dih.last_index_time has bad Date.toString() format during first delta import
> ----------------------------------------------------------------------------
>
> Key: SOLR-4376
> URL: https://issues.apache.org/jira/browse/SOLR-4376
> Project: Solr
> Issue Type: Bug
> Components: contrib - DataImportHandler
> Affects Versions: 4.1
> Reporter: Sebastien Lorber
> Priority: Minor
>
> Hi
> In:
> org.apache.solr.handler.dataimport.DocBuilder#getVariableResolver
> {code:java}
> private static final Date EPOCH = new Date(0);
> if (persistedProperties.get(LAST_INDEX_TIME) != null) {
> // String added to map
> indexerNamespace.put(LAST_INDEX_TIME,
> persistedProperties.get(LAST_INDEX_TIME));
> } else {
> // Date added to map
> indexerNamespace.put(LAST_INDEX_TIME, EPOCH);
> }
> {code}
> When LAST_INDEX_TIME is found in the data-import.properties, the value in the
> map is a String.
> When LAST_INDEX_TIME is not found, we use timestamp = 0, but the value is a
> Date
> When using full-import it works fine because basically we don't need this
> LAST_INDEX_TIME.
> When doing delta import after a full import it also works fine.
> But when doing a first delta import on a clean configuration, without any
> data-import.properties present, I have an SQL exception because of this query:
> SELECT xxx
> FROM BATCH_JOB_EXECUTION yyy
> WHERE last_updated > Thu Jan 01 01:00:00 CET 1970
> I think in any case, the value associated to the key in the map must be
> consistent and either be String or Date, but not both.
> Personally I would expect it to be stored as String, and the EPOCH date being
> formatted in the exact same format the date properties are persisted in the
> file, which is:
> org.apache.solr.handler.dataimport.SimplePropertiesWriter#dateFormat
> This doesn't have a real impact on our code but it is just that an
> integration test "test_delta_import_when_never_indexed" was unexpectedly
> failing while all others were ok, after a Solr 1.4 to Solr 4.1 migration.
> Thus it seems to be a minor regression.
> Thanks
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]