Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* config and build script updates for pulling in solr 4.10.4 (solr bi… #502

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions priv/conf/_rest_managed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"initArgs":{},"managedList":[]}
49 changes: 13 additions & 36 deletions priv/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
this file, see http://wiki.apache.org/solr/SolrConfigXml.
-->
<config>
<luceneMatchVersion>4.7</luceneMatchVersion>
<luceneMatchVersion>4.10.4</luceneMatchVersion>
<lib dir="${yz.lib.dir}" />

<!-- Data Directory
Expand All @@ -20,9 +20,12 @@

solr.StandardDirectoryFactory, the default, is filesystem
based and tries to pick the best implementation for the current
JVM and platform. One can force a particular implementation
via solr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or
solr.SimpleFSDirectoryFactory.
JVM and platform. solr.NRTCachingDirectoryFactory, the default,
wraps solr.StandardDirectoryFactory and caches small files in memory
for better NRT performance.

One can force a particular implementation via solr.MMapDirectoryFactory,
solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.

solr.RAMDirectoryFactory is memory based, not
persistent, and doesn't work with replication.
Expand All @@ -38,6 +41,12 @@
<!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
<!-- <writeLockTimeout>1000</writeLockTimeout> -->

<!-- The maximum number of simultaneous threads that may be
indexing documents at once in IndexWriter; if more than this
many threads arrive they will wait for others to finish.
Default in Solr/Lucene is 8. -->
<!-- <maxIndexingThreads>8</maxIndexingThreads> -->

<!-- Expert: Enabling compound file will use less files for the index,
using fewer file descriptors on the expense of performance decrease.
Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
Expand Down Expand Up @@ -326,7 +335,6 @@
size="512"
autowarmCount="0"
showItems="32" />


<!-- Lazy Field Loading

Expand Down Expand Up @@ -542,37 +550,6 @@
</arr>
</requestHandler>

<!-- Update Request Handler.

http://wiki.apache.org/solr/UpdateXmlMessages

The canonical Request Handler for Modifying the Index through
commands specified using XML, JSON, CSV, or JAVABIN

Note: Since solr1.1 requestHandlers requires a valid content
type header if posted in the body. For example, curl now
requires: -H 'Content-type:text/xml; charset=utf-8'

To override the request content type and force a specific
Content-type, use the request parameter:
?update.contentType=text/csv

This handler will pick a response format to match the input
if the 'wt' parameter is not explicit
-->
<requestHandler name="/update" class="solr.UpdateRequestHandler">
<!-- See below for information on defining
updateRequestProcessorChains that can be used by name
on each Update Request
-->
<!--
<lst name="defaults">
<str name="update.chain">dedupe</str>
</lst>
-->
</requestHandler>


<!-- Solr Cell Update Request Handler

http://wiki.apache.org/solr/ExtractingRequestHandler
Expand Down
3 changes: 1 addition & 2 deletions priv/default_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,8 @@
<!-- Thai -->
<fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<tokenizer class="solr.ThaiTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ThaiWordFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
</analyzer>
</fieldType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,73 +1,59 @@
From a2e77eaa262bd24c8bf3250d85fa0b3cab7d33e7 Mon Sep 17 00:00:00 2001
From: Ryan Zezeski <[email protected]>
Date: Tue, 12 Feb 2013 11:54:21 -0500
Subject: [PATCH] Disable stale check and nagle
commit 13449f7dc2ac0d205180611f2de6e1371cd88a4b
Author: Zeeshan Lakhani <[email protected]>
Date: Thu May 7 00:20:08 2015 +0900

* Apache HTTP's stale conn check causes additionall latency and
is not recommended for high-throughput/low-latency scenarios.

* Disabling the stale check requires adding a periodic background
task which clears idles connections. This prevents the client
from pulling a conn closed by the server which causes an IOException.

* Disable nagle as it's meant for protocols that use many small messages.
---
.../solr/handler/component/HttpShardHandlerFactory.java | 3 +++
.../org/apache/solr/client/solrj/impl/HttpClientUtil.java | 13 +++++++++++++
2 files changed, 16 insertions(+)
Update patches for Solr 4.10.4

diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
index 3f91f17..e8b018e 100644
index f574f29..42168df 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
@@ -17,6 +17,7 @@ package org.apache.solr.handler.component;
*/
@@ -29,6 +29,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang.StringUtils;
+import org.apache.http.params.HttpConnectionParams;
import org.apache.http.client.HttpClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpClientUtil;
@@ -153,6 +154,8 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
clientParams.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, connectionTimeout);
clientParams.set(HttpClientUtil.PROP_USE_RETRY, false);
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
@@ -163,7 +164,8 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
clientParams.set(HttpClientUtil.PROP_USE_RETRY, false);
}
this.defaultClient = HttpClientUtil.createClient(clientParams);
-
+ this.defaultClient.getParams().setParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, false);
+ this.defaultClient.getParams().setParameter(HttpConnectionParams.TCP_NODELAY, true);
this.loadbalancer = createLoadbalancer(defaultClient);
}

// must come after createClient
if (useRetries) {
// our default retry handler will never retry on IOException if the request has been sent already,
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
index b7c0680..8ca13f3 100644
index fcbc80d..c98c982 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
@@ -18,6 +18,9 @@ package org.apache.solr.client.solrj.impl;
@@ -17,6 +17,9 @@
package org.apache.solr.client.solrj.impl;

import java.io.IOException;
import java.io.InputStream;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;

@@ -110,6 +113,16 @@ public class HttpClientUtil {
@@ -115,6 +118,16 @@ public class HttpClientUtil {
logger.debug("Creating new http client, config:" + config);
}
final DefaultHttpClient httpClient = new SystemDefaultHttpClient();
+ final org.apache.http.conn.ClientConnectionManager mgr = httpClient.getConnectionManager();
+
+ // NOTE: The sweeper task is assuming hard-coded Jetty max-idle of 50s.
+ // Note: The sweeper task is assuming hard-coded Jetty max-idle of 50s.
+ final Runnable sweeper = new Runnable() {
+ public void run() {
+ mgr.closeIdleConnections(40, TimeUnit.SECONDS);
+ }
+ };
+ public void run() {
+ mgr.closeIdleConnections(40, TimeUnit.SECONDS);
+ }
+ };
+ final ScheduledExecutorService stp = Executors.newScheduledThreadPool(1);
+ stp.scheduleWithFixedDelay(sweeper, 5, 5, TimeUnit.SECONDS);
configureClient(httpClient, config);
return httpClient;
}
--
1.9.0

4 changes: 2 additions & 2 deletions tools/build-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ if [ ! -x "`which javac`" ] || [ ! -x "`which jar`" ]; then
exit 1
fi

if ! javac -version 2>&1 | egrep "1\.6\.[0-9_.]+"
if ! javac -version 2>&1 | egrep "1\.7\.[0-9_.]+"
then
echo "JDK 1.6 must be used to compile these jars"
echo "JDK 1.7 must be used to compile these jars"
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions tools/build-solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#>
#> Example:
#>
#> ./build-solr.sh --patch-dir ~/yokozuna/solr-patches /tmp/build-solr solr-4.7.0-yz http://archive.apache.org/dist/lucene/solr/4.7.0/solr-4.7.0-src.tgz | tee build-solr.out
#> ./build-solr.sh --patch-dir ~/yokozuna/solr-patches /tmp/build-solr solr-4.10.4-yz http://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4-src.tgz | tee build-solr.out

set -e

Expand Down Expand Up @@ -79,9 +79,9 @@ WORK_DIR=$1; shift
NAME=$1; shift
URL=$1; shift

if ! javac -version 2>&1 | egrep "1\.6\.[0-9_.]+"
if ! javac -version 2>&1 | egrep "1\.7\.[0-9_.]+"
then
echo "JDK 1.6 must be used to compile Solr"
echo "JDK 1.7 must be used to compile Solr"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion tools/grab-solr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PRIV_DIR=../priv
CONF_DIR=$PRIV_DIR/conf
SOLR_DIR=$PRIV_DIR/solr
BUILD_DIR=../build
VSN=solr-4.7.0-yz-1
VSN=solr-4.10.4-yz-1
FILENAME=$VSN.tgz
TMP_DIR=/var/tmp/yokozuna
TMP_FILE=$TMP_DIR/$FILENAME
Expand Down