lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minoru Osuka (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-4751) The replication problem of the file in a subdirectory.
Date Wed, 01 May 2013 15:46:16 GMT

    [ https://issues.apache.org/jira/browse/SOLR-4751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646658#comment-13646658
] 

Minoru Osuka commented on SOLR-4751:
------------------------------------

Hi Sekiguchi-san,



Please see following code,
core/src/java/org/apache/solr/handler/SnapPuller.java
{code:java}
  private void copyTmpConfFiles2Conf(File tmpconfDir) {
    File confDir = new File(solrCore.getResourceLoader().getConfigDir());
    for (File file : tmpconfDir.listFiles()) {
      File oldFile = new File(confDir, file.getName());
      if (oldFile.exists()) {
        File backupFile = new File(confDir, oldFile.getName() + "." + getDateAsStr(new Date(oldFile.lastModified())));
        boolean status = oldFile.renameTo(backupFile);
        if (!status) {
          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                  "Unable to rename: " + oldFile + " to: " + backupFile);
        }
      }
      boolean status = file.renameTo(oldFile);
      if (status) {
      } else {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "Unable to rename: " + file + " to: " + oldFile);
      }
    }
  }
{code}

This code does not assume subdirectory exists in conf directory.
Only the files specified by confFiles exists in temporary directory. All files are not gathered
in lang directory in temporary directory.
This code will rename incomplete lang directory to conf directory.
Need to find files recursively.

                
> The replication problem of the file in a subdirectory.
> ------------------------------------------------------
>
>                 Key: SOLR-4751
>                 URL: https://issues.apache.org/jira/browse/SOLR-4751
>             Project: Solr
>          Issue Type: Bug
>          Components: replication (java)
>    Affects Versions: 4.2.1
>            Reporter: Minoru Osuka
>            Priority: Minor
>         Attachments: SOLR-4751.patch
>
>
> When set lang/stopwords_ja.txt to confFiles in replication settings,
> {code:xml}
>   <requestHandler name="/replication" class="solr.ReplicationHandler" >
>        <lst name="master">
>          <str name="replicateAfter">commit</str>
>          <str name="replicateAfter">startup</str>
>          <str name="confFiles">schema.xml,stopwords.txt,lang/stopwords_ja.txt</str>
>        </lst>
>   </requestHandler>
> {code}
> Only stopwords_ja.txt exists in solr/collection1/conf/lang directory on slave node.

--
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