You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2017/03/14 02:19:59 UTC

[23/23] lucene-solr:jira/solr-9835: Merge branch 'master' into jira/solr-9835

Merge branch 'master' into jira/solr-9835


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2f64575d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2f64575d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2f64575d

Branch: refs/heads/jira/solr-9835
Commit: 2f64575dc9064353d32ce7cc8a811ad94d9fd7c7
Parents: f32977d faeb1fe
Author: Cao Manh Dat <da...@apache.org>
Authored: Tue Mar 14 09:18:06 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Tue Mar 14 09:18:06 2017 +0700

----------------------------------------------------------------------
 dev-tools/scripts/smokeTestRelease.py           |   4 +
 lucene/CHANGES.txt                              |  19 +
 .../org/apache/lucene/document/DoubleRange.java | 271 +++++++++++++++
 .../org/apache/lucene/document/FieldType.java   |   6 +-
 .../org/apache/lucene/document/FloatRange.java  | 271 +++++++++++++++
 .../org/apache/lucene/document/IntRange.java    | 271 +++++++++++++++
 .../org/apache/lucene/document/LongRange.java   | 269 ++++++++++++++
 .../apache/lucene/document/RangeFieldQuery.java | 340 ++++++++++++++++++
 .../lucene/index/ConcurrentMergeScheduler.java  |  75 ++--
 .../org/apache/lucene/index/IndexWriter.java    |  94 ++---
 .../org/apache/lucene/index/MergePolicy.java    | 184 +++++++++-
 .../apache/lucene/index/MergeRateLimiter.java   | 177 ++++------
 .../org/apache/lucene/index/MergeScheduler.java |  12 +
 .../apache/lucene/index/NoMergeScheduler.java   |   7 +
 .../org/apache/lucene/index/PointValues.java    |   2 +-
 .../org/apache/lucene/search/BooleanQuery.java  |   1 -
 .../lucene/index/TestMergeRateLimiter.java      |   4 +-
 .../search/TestDoubleRangeFieldQueries.java     | 251 ++++++++++++++
 .../search/TestFloatRangeFieldQueries.java      | 251 ++++++++++++++
 .../lucene/search/TestIntRangeFieldQueries.java | 251 ++++++++++++++
 .../search/TestLongRangeFieldQueries.java       | 251 ++++++++++++++
 .../lucene/document/InetAddressPoint.java       | 313 +++++++++++++++++
 .../lucene/document/InetAddressRange.java       | 168 +++++++++
 .../lucene/document/TestInetAddressPoint.java   | 176 ++++++++++
 .../search/TestInetAddressRangeQueries.java     | 215 ++++++++++++
 .../lucene/document/DoubleRangeField.java       | 282 ---------------
 .../apache/lucene/document/FloatRangeField.java | 282 ---------------
 .../lucene/document/InetAddressPoint.java       | 313 -----------------
 .../apache/lucene/document/IntRangeField.java   | 282 ---------------
 .../apache/lucene/document/LongRangeField.java  | 280 ---------------
 .../apache/lucene/document/RangeFieldQuery.java | 340 ------------------
 .../org/apache/lucene/document/package.html     |   3 +-
 .../lucene/document/TestDoubleRangeField.java   |  10 +-
 .../lucene/document/TestInetAddressPoint.java   | 176 ----------
 .../search/BaseRangeFieldQueryTestCase.java     | 344 ------------------
 .../search/TestDoubleRangeFieldQueries.java     | 251 --------------
 .../search/TestFloatRangeFieldQueries.java      | 251 --------------
 .../lucene/search/TestIntRangeFieldQueries.java | 251 --------------
 .../search/TestLongRangeFieldQueries.java       | 251 --------------
 .../search/BaseRangeFieldQueryTestCase.java     | 346 +++++++++++++++++++
 solr/CHANGES.txt                                |  19 +
 .../java/org/apache/solr/api/V2HttpCall.java    |   2 +-
 .../org/apache/solr/cloud/RecoveryStrategy.java | 106 ++++--
 .../java/org/apache/solr/core/PluginBag.java    |   2 +-
 .../java/org/apache/solr/core/SolrConfig.java   |   2 +
 .../src/java/org/apache/solr/core/SolrCore.java |  22 +-
 .../org/apache/solr/handler/StreamHandler.java  |   3 +-
 .../solr/schema/AbstractSpatialFieldType.java   |   2 +-
 .../org/apache/solr/schema/DatePointField.java  |  11 -
 .../apache/solr/schema/DoublePointField.java    |  12 -
 .../java/org/apache/solr/schema/EnumField.java  |   9 -
 .../java/org/apache/solr/schema/FieldType.java  |  11 -
 .../org/apache/solr/schema/FloatPointField.java |  13 -
 .../org/apache/solr/schema/IntPointField.java   |  11 -
 .../solr/schema/LatLonPointSpatialField.java    | 272 +++++++++++++++
 .../org/apache/solr/schema/LongPointField.java  |  11 -
 .../schema/SpatialPointVectorFieldType.java     |   7 -
 .../java/org/apache/solr/schema/TrieField.java  |  17 -
 .../apache/solr/servlet/SolrDispatchFilter.java |   2 +-
 .../solr/update/DefaultSolrCoreState.java       |  15 +-
 .../org/apache/solr/update/SolrCoreState.java   |   6 +
 .../processor/AtomicUpdateDocumentMerger.java   |  11 +-
 .../org/apache/solr/util/stats/MetricUtils.java |   7 +-
 .../solr/collection1/conf/schema-spatial.xml    |   4 +
 .../solrconfig-configurerecoverystrategy.xml    |  28 ++
 .../conf/solrconfig-customrecoverystrategy.xml  |  32 ++
 .../conf/solrconfig-managed-schema.xml          |   2 +-
 .../org/apache/solr/cloud/rule/RulesTest.java   |   2 +-
 .../core/ConfigureRecoveryStrategyTest.java     | 111 ++++++
 .../apache/solr/core/TestDynamicLoading.java    |   2 +-
 .../apache/solr/core/TestSolrConfigHandler.java |  14 +-
 .../apache/solr/handler/TestReqParamsAPI.java   |   3 +
 .../solr/handler/V2ApiIntegrationTest.java      |   4 +-
 .../solr/handler/admin/MetricsHandlerTest.java  |  11 +-
 .../solr/rest/schema/TestBulkSchemaAPI.java     |   2 +-
 .../apache/solr/search/TestSolr4Spatial.java    |  61 +++-
 .../solr/security/BasicAuthIntegrationTest.java |   4 +-
 .../solr/update/TestInPlaceUpdatesDistrib.java  |  89 +++--
 .../update/TestInPlaceUpdatesStandalone.java    |  27 ++
 .../update/processor/AtomicUpdatesTest.java     |   3 +-
 solr/server/etc/jetty.xml                       |  54 +--
 .../basic_configs/conf/managed-schema           |   7 +-
 .../conf/managed-schema                         |   7 +-
 .../conf/managed-schema                         |   7 +-
 .../conf/solrconfig.xml                         |   2 +-
 .../solr/client/solrj/impl/CloudSolrClient.java |  21 +-
 .../solrj/io/eval/NaturalLogEvaluator.java      |  60 ++++
 .../solrj/embedded/SolrExampleJettyTest.java    |   2 +-
 .../client/solrj/impl/CloudSolrClientTest.java  |  48 +++
 .../io/stream/eval/NaturalLogEvaluatorTest.java |  98 ++++++
 90 files changed, 5074 insertions(+), 3749 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2f64575d/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index 52efff9,8865c08..cb6c69c
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@@ -91,10 -118,8 +118,9 @@@ public class RecoveryStrategy extends T
    private boolean recoveringAfterStartup;
    private CoreContainer cc;
    private volatile HttpUriRequest prevSendPreRecoveryHttpUriRequest;
 -  
 +  private boolean onlyLeaderIndexes;
 +
-   // this should only be used from SolrCoreState
-   public RecoveryStrategy(CoreContainer cc, CoreDescriptor cd, RecoveryListener recoveryListener) {
+   protected RecoveryStrategy(CoreContainer cc, CoreDescriptor cd, RecoveryListener recoveryListener) {
      this.cc = cc;
      this.coreName = cd.getName();
      this.recoveryListener = recoveryListener;
@@@ -103,11 -128,37 +129,39 @@@
      zkStateReader = zkController.getZkStateReader();
      baseUrl = zkController.getBaseUrl();
      coreZkNodeName = cd.getCloudDescriptor().getCoreNodeName();
 +    String collection = cd.getCloudDescriptor().getCollectionName();
 +    onlyLeaderIndexes = zkStateReader.getClusterState().getCollection(collection).getRealtimeReplicas() == 1;
    }
  
-   public void setRecoveringAfterStartup(boolean recoveringAfterStartup) {
+   final public int getWaitForUpdatesWithStaleStatePauseMilliSeconds() {
+     return waitForUpdatesWithStaleStatePauseMilliSeconds;
+   }
+ 
+   final public void setWaitForUpdatesWithStaleStatePauseMilliSeconds(int waitForUpdatesWithStaleStatePauseMilliSeconds) {
+     this.waitForUpdatesWithStaleStatePauseMilliSeconds = waitForUpdatesWithStaleStatePauseMilliSeconds;
+   }
+ 
+   final public int getMaxRetries() {
+     return maxRetries;
+   }
+ 
+   final public void setMaxRetries(int maxRetries) {
+     this.maxRetries = maxRetries;
+   }
+ 
+   final public int getStartingRecoveryDelayMilliSeconds() {
+     return startingRecoveryDelayMilliSeconds;
+   }
+ 
+   final public void setStartingRecoveryDelayMilliSeconds(int startingRecoveryDelayMilliSeconds) {
+     this.startingRecoveryDelayMilliSeconds = startingRecoveryDelayMilliSeconds;
+   }
+ 
+   final public boolean getRecoveringAfterStartup() {
+     return recoveringAfterStartup;
+   }
+ 
+   final public void setRecoveringAfterStartup(boolean recoveringAfterStartup) {
      this.recoveringAfterStartup = recoveringAfterStartup;
    }
  
@@@ -536,20 -587,8 +598,20 @@@
      LOG.info("Finished recovery process, successful=[{}]", Boolean.toString(successfulRecovery));
    }
  
 +  public static Runnable testing_beforeReplayBufferingUpdates;
 +
-   private Future<RecoveryInfo> replay(SolrCore core)
+   final private Future<RecoveryInfo> replay(SolrCore core)
        throws InterruptedException, ExecutionException {
 +    if (testing_beforeReplayBufferingUpdates != null) {
 +      testing_beforeReplayBufferingUpdates.run();
 +    }
 +    if (onlyLeaderIndexes) {
 +      // roll over all updates during buffering to new tlog, make RTG available
 +      SolrQueryRequest req = new LocalSolrQueryRequest(core,
 +          new ModifiableSolrParams());
 +      core.getUpdateHandler().getUpdateLog().copyOverBufferingUpdates(new CommitUpdateCommand(req, false));
 +      return null;
 +    }
      Future<RecoveryInfo> future = core.getUpdateHandler().getUpdateLog().applyBufferedUpdates();
      if (future == null) {
        // no replay needed\

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2f64575d/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
----------------------------------------------------------------------
diff --cc solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
index 6ae5476,bb0ab9a..7a4fa86
--- a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
+++ b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java
@@@ -716,11 -740,7 +749,11 @@@ public class TestInPlaceUpdatesDistrib 
          DBQ(q=val:10, v=4)
          DV(id=x, val=5, ver=3)
     */
-   private void reorderedDBQsWithInPlaceUpdatesShouldNotThrowReplicaInLIRTest() throws Exception {
+   private void reorderedDBQsResurrectionTest() throws Exception {
 +    if (onlyLeaderIndexes) {
 +      log.info("RTG with DBQs are not working in append replicas");
 +      return;
 +    }
      clearIndex();
      commit();
  
@@@ -1117,11 -1137,7 +1150,11 @@@
     * inp(id=1,inpfield=14,prevVersion=2,version=3) // will wait till timeout, and then fetch a "not found" from leader
     * dbq("inp:14",version=4)
     */
-   private void testDBQUsingUpdatedFieldFromDroppedUpdate() throws Exception {
+   private void reorderedDBQsUsingUpdatedValueFromADroppedUpdate() throws Exception {
 +    if (onlyLeaderIndexes) {
 +      log.info("RTG with DBQs are not working in append replicas");
 +      return;
 +    }
      clearIndex();
      commit();