Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Use a HashSet to workaround suspected Lucene bug which returns same file name multiple times

Shalin Shekhar Mangarfd6b300d8bb6
diff --git a/src/java/org/apache/solr/handler/ReplicationHandler.java b/src/java/org/apache/solr/handler/ReplicationHandler.java
index d475e58e40f..6f10eac2d3b 100644
--- a/src/java/org/apache/solr/handler/ReplicationHandler.java
+++ b/src/java/org/apache/solr/handler/ReplicationHandler.java
@@ -268,7 +268,8 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
try {
//get all the files in the commit
- Collection<String> files = commit.getFileNames();
+ //use a set to workaround possible Lucene bug which returns same file name multiple times
+ Collection<String> files = new HashSet<String>(commit.getFileNames());
for (String fileName : files) {
File file = new File(core.getIndexDir(), fileName);
Map<String, Object> fileMeta = getFileInfo(file);