lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregg Donovan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-4413) SolrCore#getIndexDir() contract change between 3.6 and 4.1
Date Tue, 12 Feb 2013 22:11:14 GMT

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

Gregg Donovan updated SOLR-4413:
--------------------------------

    Attachment: SOLR-4413.patch

This patch is the full set of changes we needed to make the index.properties edit + core reload
reindexing mechanism that we used in 3.6 work in 4.1.

In addition to the changes to SolrCore#getIndexDir(), we needed to check for a change of directory
when the new SolrCore decided to either inherit a DirectoryFactory, DeletionPolicy, or UpdateHandler
from the previous core or reuse the previous core's Directory for a searcher. In each case,
the state from the previous core would cause problems when inherited by the new core.

The test suite passes with the full set of changes, but I'm not sure they should all be grouped
in one JIRA or not. Mark -- please let me know if you think they should be broken out. If
not, perhaps we should change the title of this ticket?
                
> SolrCore#getIndexDir() contract change between 3.6 and 4.1
> ----------------------------------------------------------
>
>                 Key: SOLR-4413
>                 URL: https://issues.apache.org/jira/browse/SOLR-4413
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.0, 4.1
>            Reporter: Gregg Donovan
>            Assignee: Mark Miller
>             Fix For: 4.2, 5.0
>
>         Attachments: SOLR-4413.patch
>
>
> In [SVN 1420992|http://svn.apache.org/viewvc?view=revision&revision=1420992], {{SolrCore#getIndexDir()}}
changed it's implementation from a version that would reflect the value of the index property
in {{index.properties}} to one that does not. 
> In 3.6, {{SolrCore#getIndexDir()}} was:
> {code:java}
> public String getIndexDir() {
>   synchronized (searcherLock) {
>     if (_searcher == null)	  	
>       return dataDir + "index/";
>     SolrIndexSearcher searcher = _searcher.get();
>     return searcher.getIndexDir() == null ? dataDir + "index/" : searcher.getIndexDir();
> }
> {code}
> In 3.6, {{SolrIndexSearcher}} would be passed the value of {{SolrCore#getNewIndexDir()}}
-- which reads index.properties -- in its constructor and return it when {{SolrIndexSearcher#getIndexDir()}}
was called.
>  
> In 4.1, {{SolrCore#getIndexDir()}} is:
> {code:java}
>   public String getIndexDir() {  
>     return dataDir + "index/";
>   }
> {code}
> Clients of {{SolrCore#getIndexDir()}} that were expecting the previous behavior are likely
to have issues. E.g.:
> --In {{CoreAdminHandler#handleUnloadAction(SolrQueryRequest, SolrQueryResponse)}} if
the {{deleteIndex}} flag is set to true, it calls {{core.getDirectoryFactory().remove(core.getIndexDir())}}.
If a value other than {{index/}} is set in {{index.properties}}, the wrong directory will
be deleted.
> --In {{CoreAdminHandler#getIndexSize(SolrCore)}}, the existence of {{SolrCore#getIndexDir()}}
is checked before {{SolrCore#getNewIndexDir()}}. If a value other than {{index/}} is set in
{{index.properties}}, this will return the size of the wrong directory.

--
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message