You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/10/02 04:15:00 UTC

[lucene-solr] branch reference_impl_dev updated (6c69b21 -> e3df847)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a change to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 6c69b21  @915 Move setting to correct place.
     new d936cd8  @916 Single file watch process again, retry for metrics less.
     new 77386fe  @917 Idle timeout for dist updates raise.
     new 0aa3e89  @918 Synchronization tweaks.
     new e3df847  @919 Default DocCollection version fix.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/solr/update/SolrCmdDistributor.java |  3 +-
 .../src/java/org/apache/solr/update/UpdateLog.java | 34 ++++++++++++----------
 .../java/org/apache/solr/update/VersionInfo.java   |  3 +-
 .../solrj/impl/SolrClientNodeStateProvider.java    |  4 +--
 .../apache/solr/common/cloud/DocCollection.java    |  2 +-
 .../org/apache/solr/common/cloud/SolrZkClient.java |  4 +--
 6 files changed, 27 insertions(+), 23 deletions(-)


[lucene-solr] 03/04: @918 Synchronization tweaks.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 0aa3e895f021ed0c4b79f234cd9c422b7000de5d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Oct 1 22:49:41 2020 -0500

    @918 Synchronization tweaks.
---
 .../src/java/org/apache/solr/update/UpdateLog.java | 34 ++++++++++++----------
 .../java/org/apache/solr/update/VersionInfo.java   |  3 +-
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/update/UpdateLog.java b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
index eed84fa..81cf654 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateLog.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateLog.java
@@ -638,7 +638,7 @@ public class UpdateLog implements PluginInfoInitialized, SolrMetricProducer {
    *        not an in-place update at all, and don't bother about the prevPointer value at
    *        all (which is -1 as a dummy value).)
    */
-  private synchronized long getPrevPointerForUpdate(AddUpdateCommand cmd) {
+  private long getPrevPointerForUpdate(AddUpdateCommand cmd) {
     // note: sync required to ensure maps aren't changed out form under us
     if (cmd.isInPlaceUpdate()) {
       BytesRef indexedId = cmd.getIndexedId();
@@ -736,29 +736,31 @@ public class UpdateLog implements PluginInfoInitialized, SolrMetricProducer {
     // We must cause a new IndexReader to be opened before anything looks at these caches again
     // so that a cache miss will read fresh data.
     RefCounted<SolrIndexSearcher> holder = null;
+    tlogLock.lock();
     try {
-      holder = uhandler.core.openNewSearcher(true, true);
-
-    } catch (Exception e) {
-      ParWork.propagateInterrupt(e, true);
-      SolrException.log(log, "Error opening realtime searcher", e);
-      return null;
-    } finally {
-      tlogLock.lock();
       try {
+        holder = uhandler.core.openNewSearcher(true, true);
+
+      } catch (Exception e) {
+        ParWork.propagateInterrupt(e, true);
+        SolrException.log(log, "Error opening realtime searcher", e);
+        return null;
+      } finally {
+
         if (map != null) map.clear();
         if (prevMap != null) prevMap.clear();
         if (prevMap2 != null) prevMap2.clear();
-      } finally {
-        tlogLock.unlock();
+
+        if (!returnSearcher && holder != null) holder.decref();
       }
-      if (!returnSearcher && holder != null) holder.decref();
-    }
 
-    if (returnSearcher) {
-      return holder;
+      if (returnSearcher) {
+        return holder;
+      }
+      return null;
+    } finally {
+      tlogLock.unlock();
     }
-    return null;
   }
 
   /** currently for testing only */
diff --git a/solr/core/src/java/org/apache/solr/update/VersionInfo.java b/solr/core/src/java/org/apache/solr/update/VersionInfo.java
index a9edf11..efa3676 100644
--- a/solr/core/src/java/org/apache/solr/update/VersionInfo.java
+++ b/solr/core/src/java/org/apache/solr/update/VersionInfo.java
@@ -198,10 +198,11 @@ public class VersionInfo {
     // Make sure high bits are moved down, since only the low bits will matter.
     // int h = hash + (hash >>> 8) + (hash >>> 16) + (hash >>> 24);
     // Assume good hash codes for now.
-    int slot = hash & (buckets.length - 1);
+    int slot;
     buckUpdateLock.readLock().lock();
     VersionBucket bucket;
     try {
+      slot = hash & (buckets.length - 1);
       bucket = buckets[slot];
     } finally {
       buckUpdateLock.readLock().unlock();


[lucene-solr] 01/04: @916 Single file watch process again, retry for metrics less.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit d936cd80fa9671080534bb967fe2c929547fdeab
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Oct 1 22:18:16 2020 -0500

    @916 Single file watch process again, retry for metrics less.
---
 .../apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java    | 4 ++--
 solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
index 40b5b3f..63d6931 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientNodeStateProvider.java
@@ -348,10 +348,10 @@ public class SolrClientNodeStateProvider implements NodeStateProvider, MapWriter
     }
 
     /**
-     * Will attempt to call {@link #invoke(String, String, SolrParams)} up to five times, retrying on any IO Exceptions
+     * Will attempt to call {@link #invoke(String, String, SolrParams)}, retrying on any IO Exceptions
      */
     public SimpleSolrResponse invokeWithRetry(String solrNode, String path, SolrParams params) throws InterruptedException, IOException, SolrServerException {
-      int retries = 3;
+      int retries = 2;
       int cnt = 0;
 
       while (cnt++ < retries) {
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
index e50f8d6..a2e570b2 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
@@ -98,9 +98,9 @@ public class SolrZkClient implements Closeable {
   private final ConnectionManager connManager;
 
   // what about ensuring order of state updates per collection??
-  final ExecutorService zkCallbackExecutor = ParWork.getParExecutorService("zkCallbackExecutor", 4, 9, 1000, new BlockingArrayQueue());
+  final ExecutorService zkCallbackExecutor = ParWork.getParExecutorService("zkCallbackExecutor", 1, 1, 60000, new BlockingArrayQueue());
 
-  final ExecutorService zkConnManagerCallbackExecutor = ParWork.getParExecutorService("zkConnManagerCallbackExecutor",1, 1, 1, new BlockingArrayQueue());
+  final ExecutorService zkConnManagerCallbackExecutor = ParWork.getParExecutorService("zkConnManagerCallbackExecutor",1, 1, 60000, new BlockingArrayQueue());
 
   private volatile boolean isClosed = false;
 


[lucene-solr] 02/04: @917 Idle timeout for dist updates raise.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 77386fe3cc773aa0773c84b15a0b8bedacb12d8c
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Oct 1 22:21:45 2020 -0500

    @917 Idle timeout for dist updates raise.
---
 solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index 3baad83..2025633 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Phaser;
 import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.BinaryResponseParser;
@@ -67,7 +68,7 @@ public class SolrCmdDistributor implements Closeable {
 
   public SolrCmdDistributor(UpdateShardHandler updateShardHandler) {
     assert ObjectReleaseTracker.track(this);
-    this.solrClient = new Http2SolrClient.Builder().withHttpClient(updateShardHandler.getTheSharedHttpClient()).strictEventOrdering(true).build();
+    this.solrClient = new Http2SolrClient.Builder().withHttpClient(updateShardHandler.getTheSharedHttpClient()).strictEventOrdering(true).idleTimeout((int) TimeUnit.MINUTES.toMillis(5)).build();
   }
 
   public void finish() {


[lucene-solr] 04/04: @919 Default DocCollection version fix.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit e3df847534b6b6feeb09b90e0d7f82053687356d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Oct 1 23:02:27 2020 -0500

    @919 Default DocCollection version fix.
---
 solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
index d7d7494..345305a 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
@@ -84,7 +84,7 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {
    */
   public DocCollection(String name, Map<String, Slice> slices, Map<String, Object> props, DocRouter router, int zkVersion) {
     super(props==null ? props = new HashMap<>() : props);
-    this.znodeVersion = zkVersion == -1 ? 1 : zkVersion;
+    this.znodeVersion = zkVersion == -1 ? 0 : zkVersion;
     this.name = name;
 
     this.slices = slices;