Apache Solr open-source search software
SOLR-8494: SimplePostTool and therefore the bin/post script cannot upload files larger than 2.1GB
Shalin Shekhar Mangar71a18c4ddc74
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex a7d55096a5d..18ca8f2551a 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -334,6 +334,8 @@ Bug Fixes* SOLR-8418: Adapt to changes in LUCENE-6590 for use of boosts with MLTHandler andSimple/CloudMLTQParser (Jens Wille, Ramkumar Aiyengar)+* SOLR-8494: SimplePostTool and therefore the bin/post script cannot upload files larger than 2.1GB. (shalin)+Other Changes----------------------diff --git a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java b/solr/core/src/java/org/apache/solr/util/SimplePostTool.javaindex 868cf6316e3..2947bfdf859 100644--- a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java+++ b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java@@ -17,11 +17,6 @@ package org.apache.solr.util;* limitations under the License.*/-import org.w3c.dom.Document;-import org.w3c.dom.Node;-import org.w3c.dom.NodeList;-import org.xml.sax.SAXException;-import javax.xml.bind.DatatypeConverter;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;@@ -60,13 +55,17 @@ import java.util.Locale;import java.util.Map;import java.util.Set;import java.util.TimeZone;-import java.util.concurrent.TimeUnit;import java.util.regex.Pattern;import java.util.regex.PatternSyntaxException;import java.util.zip.GZIPInputStream;import java.util.zip.Inflater;import java.util.zip.InflaterInputStream;+import org.w3c.dom.Document;+import org.w3c.dom.Node;+import org.w3c.dom.NodeList;+import org.xml.sax.SAXException;+/*** A simple utility class for posting raw updates to a Solr server,* has a main method so it can be run on the command line.@@ -791,7 +790,7 @@ public class SimplePostTool {}info("POSTing file " + file.getName() + (auto?" ("+type+")":"") + " to [base]" + suffix);is = new FileInputStream(file);- postData(is, (int)file.length(), output, type, url);+ postData(is, file.length(), output, type, url);} catch (IOException e) {e.printStackTrace();warn("Can't open/read file: " + file);@@ -861,7 +860,7 @@ public class SimplePostTool {* writes to the response to output* @return true if success*/- public boolean postData(InputStream data, Integer length, OutputStream output, String type, URL url) {+ public boolean postData(InputStream data, Long length, OutputStream output, String type, URL url) {if(mockMode) return true;boolean success = true;if(type == null)