Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4751: revert for now

Mark Robert Millercaf6b7f3c943
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6034895407f..27e26966bd0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -156,9 +156,6 @@ Bug Fixes
range in cluster state. This happens when numShards is not a power of two
and router is compositeId. (shalin)
-* SOLR-4751: Fix replication problem of files in sub directory of conf directory.
- (Minoru Osuka via Koji Sekiguchi)
-
Other Changes
----------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
index 5d96043c966..b107c8fd300 100644
--- a/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
+++ b/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
@@ -797,30 +797,15 @@ public class SnapPuller {
return true;
}
- /**
- * Make file list
- */
- private List<File> makeTmpConfDirFileList(File dir, List<File> fileList) {
- File[] files = dir.listFiles();
- for (File file : files) {
- if (file.isFile()) {
- fileList.add(file);
- } else if (file.isDirectory()) {
- fileList = makeTmpConfDirFileList(file, fileList);
- }
- }
- return fileList;
- }
-
/**
* The conf files are copied to the tmp dir to the conf dir. A backup of the old file is maintained
*/
private void copyTmpConfFiles2Conf(File tmpconfDir) {
File confDir = new File(solrCore.getResourceLoader().getConfigDir());
- for (File file : makeTmpConfDirFileList(tmpconfDir, new ArrayList<File>())) {
- File oldFile = new File(confDir, file.getPath().substring(tmpconfDir.getPath().length(), file.getPath().length()));
+ for (File file : tmpconfDir.listFiles()) {
+ File oldFile = new File(confDir, file.getName());
if (oldFile.exists()) {
- File backupFile = new File(oldFile.getPath() + "." + getDateAsStr(new Date(oldFile.lastModified())));
+ 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,