From 8353523f301a113f5586162b6475915e580f3954 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 1 Apr 2015 15:29:10 +0000 Subject: [PATCH 1/2] ignore .settings when doing diffs too (another eclipse IDE folder) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670676 13f79535-47bb-0310-9956-ffa450edef68 --- dev-tools/scripts/createPatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/scripts/createPatch.py b/dev-tools/scripts/createPatch.py index 8d46f1cd5f3..bfc95053f79 100644 --- a/dev-tools/scripts/createPatch.py +++ b/dev-tools/scripts/createPatch.py @@ -90,7 +90,7 @@ def run_diff(from_dir, to_dir, skip_whitespace): flags += 'bBw' args = ['diff', flags] - for ignore in ('.svn', '.git', 'build', '.caches', '.idea', 'idea-build', 'eclipse-build'): + for ignore in ('.svn', '.git', 'build', '.caches', '.idea', 'idea-build', 'eclipse-build', '.settings'): args.append('-x') args.append(ignore) args.append(from_dir) From f951625286f533fa06a7683a889bf0fa34e2a3cf Mon Sep 17 00:00:00 2001 From: Timothy Potter Date: Wed, 1 Apr 2015 15:29:42 +0000 Subject: [PATCH 2/2] SOLR-7266: The IgnoreCommitOptimizeUpdateProcessor blocks commit requests from replicas needing to recover. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670678 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ ...IgnoreCommitOptimizeUpdateProcessorFactory.java | 6 ++++++ ...reCommitOptimizeUpdateProcessorFactoryTest.java | 14 ++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 6f43430aab5..fc5df697f80 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -376,6 +376,9 @@ Bug Fixes * SOLR-6924: The config API forcefully refreshes all replicas in the collection to ensure all are updated (Noble Paul) +* SOLR-7266: The IgnoreCommitOptimizeUpdateProcessor blocks commit requests from + replicas needing to recover. (Jessica Cheng Mallet, Timothy Potter) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java index 5cf9afc319a..d3eea4fa050 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java @@ -118,6 +118,12 @@ class IgnoreCommitOptimizeUpdateProcessor extends UpdateRequestProcessor { return; } + if (cmd.getReq().getParams().getBool(DistributedUpdateProcessor.COMMIT_END_POINT, false)) { + // this is a targeted commit from replica to leader needed for recovery, so can't be ignored + if (next != null) next.processCommit(cmd); + return; + } + final String cmdType = cmd.optimize ? "optimize" : "commit"; if (errorCode != null) { IgnoreCommitOptimizeUpdateProcessorFactory.log.info( diff --git a/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java index 8711f62d764..0c6b1c1cef2 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java @@ -52,15 +52,29 @@ public class IgnoreCommitOptimizeUpdateProcessorFactoryTest extends SolrTestCase rsp = processCommit("ignore-optimize-only-from-client-403", true); assertNotNull("Sending an optimize should have resulted in an exception in the response", rsp.getException()); + // commit should happen if DistributedUpdateProcessor.COMMIT_END_POINT == true + rsp = processCommit("ignore-commit-from-client-403", false, new Boolean(true)); + shouldBeNull = rsp.getException(); + assertNull("Sending a commit should NOT have resulted in an exception in the response: "+shouldBeNull, shouldBeNull); } SolrQueryResponse processCommit(final String chain, boolean optimize) throws IOException { + return processCommit(chain, optimize, null); + } + + SolrQueryResponse processCommit(final String chain, boolean optimize, Boolean commitEndPoint) throws IOException { SolrCore core = h.getCore(); UpdateRequestProcessorChain pc = core.getUpdateProcessingChain(chain); assertNotNull("No Chain named: " + chain, pc); SolrQueryResponse rsp = new SolrQueryResponse(); SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams()); + + if (commitEndPoint != null) { + ((ModifiableSolrParams)req.getParams()).set( + DistributedUpdateProcessor.COMMIT_END_POINT, commitEndPoint.booleanValue()); + } + try { SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req,rsp)); CommitUpdateCommand cmd = new CommitUpdateCommand(req, false);