[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to