lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noble Paul (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (SOLR-1180) Delete only delta import does not commit index
Date Fri, 22 May 2009 11:29:45 GMT

     [ https://issues.apache.org/jira/browse/SOLR-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Noble Paul resolved SOLR-1180.
------------------------------

    Resolution: Fixed

> Delete only delta import does not commit index
> ----------------------------------------------
>
>                 Key: SOLR-1180
>                 URL: https://issues.apache.org/jira/browse/SOLR-1180
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>         Environment: OS: Windows & Linux. 
> Java: 1.6
> DB: MySQL & SQL Server
>            Reporter: Ali Syed
>            Assignee: Noble Paul
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-1180.patch
>
>
> Entity is set up in db-data-config.xml as follows
> I<entity dataSource="mysqlDS" name="contact" pk="id"
>     query="SELECT o.* FROM Contact o WHERE (o.deleted is null OR o.deleted = 0)"
>     deltaQuery="select id from Contact o where (o.deleted is null OR o.deleted = 0) AND
(o.createDate &gt; '${dataimporter.last_index_time}' OR o.updateDate &gt; '${dataimporter.last_index_time}')"
>     deletedPkQuery="select id FROM Contact o WHERE o.deleted = 1 AND (o.createDate &gt;
'${dataimporter.last_index_time}' OR o.updateDate &gt; '${dataimporter.last_index_time}')">
>     ...
> </entity>
> If a delta import is trigger which causes only documents to be deleted the index is not
commit. 
> Problem seems to be in DocBuilder.execute() method checks for deletedDocCount before
commiting.
> if (importStatistics.docCount.get() > 0 || importStatistics.deletedDocCount.get()
> 0) {
>   commit(lastIndexTimeProps);
> }
> doDelta() method sets the count as follows
> importStatistics.deletedDocCount.addAndGet(deletedKeys.size());
> but after deleteAll(Set) method removes the each key from iterator
> while (...) ...
>       iter.remove();
> Simply remove iter.remove() line should fix the problem. I am not sure what is the point
of removing the keys from the iterator.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message