lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Woodward <a...@flax.co.uk>
Subject Re: svn commit: r1547452 - in /lucene/dev/trunk/solr: ./ core/src/test/org/apache/solr/cloud/ solrj/src/java/org/apache/solr/common/cloud/
Date Tue, 03 Dec 2013 17:59:36 GMT
Hi Mark,

I don't think you meant to remove the CHANGES entry for SOLR-5517 here?

Alan Woodward
www.flax.co.uk


On 3 Dec 2013, at 16:10, markrmiller@apache.org wrote:

> Author: markrmiller
> Date: Tue Dec  3 16:10:58 2013
> New Revision: 1547452
> 
> URL: http://svn.apache.org/r1547452
> Log:
> SOLR-5502: A "/" in a document id will cause an exception to be thrown when using the
composite id router.
> 
> Modified:
>    lucene/dev/trunk/solr/CHANGES.txt
>    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java
>    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
>    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java
> 
> Modified: lucene/dev/trunk/solr/CHANGES.txt
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1547452&r1=1547451&r2=1547452&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/CHANGES.txt (original)
> +++ lucene/dev/trunk/solr/CHANGES.txt Tue Dec  3 16:10:58 2013
> @@ -189,6 +189,9 @@ Bug Fixes
> 
> * SOLR-5527: DIH logs spurious warning for special commands. (shalin)
> 
> +* SOLR-5502: A "/" in a document id will cause an exception to be thrown
> +  when using the composite id router. (Anshum Gupta via Mark Miller)
> +  
> Optimizations
> ----------------------
> 
> @@ -220,9 +223,6 @@ Other Changes
> * SOLR-5499: Log a warning if /get is not registered when using SolrCloud.
>   (Daniel Collins via shalin)
> 
> -* SOLR-5517: Return HTTP error on POST requests with no Content-Type.
> -  (Ryan Ernst, Uwe Schindler)
> -
> ==================  4.6.0 ==================
> 
> Versions of Major Components
> 
> Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java?rev=1547452&r1=1547451&r2=1547452&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java (original)
> +++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java Tue
Dec  3 16:10:58 2013
> @@ -148,30 +148,33 @@ public class ShardRoutingTest extends Ab
>     doAddDoc("d!doc3");
>     doAddDoc("e!doc4");
>     doAddDoc("f1!f2!doc5");
> +    // Check successful addition of a document with a '/' in the id part.
> +    doAddDoc("f1!f2!doc5/5");
> 
>     doRTG("b!doc1");
>     doRTG("c!doc2");
>     doRTG("d!doc3");
>     doRTG("e!doc4");
>     doRTG("f1!f2!doc5");
> +    doRTG("f1!f2!doc5/5");
>     doRTG("b!doc1,c!doc2");
>     doRTG("d!doc3,e!doc4");
> 
>     commit();
> 
> -    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5", "q","*:*");
> -    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5", "q","*:*", "shards","shard1,shard2,shard3,shard4");
> -    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5", "q","*:*", shardKeys,"b!,c!,d!,e!,f1!f2!");
> +    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5,f1!f2!doc5/5", "q","*:*");
> +    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5,f1!f2!doc5/5", "q","*:*", "shards","shard1,shard2,shard3,shard4");
> +    doQuery("b!doc1,c!doc2,d!doc3,e!doc4,f1!f2!doc5,f1!f2!doc5/5", "q","*:*", shardKeys,"b!,c!,d!,e!,f1!f2!");
>     doQuery("b!doc1", "q","*:*", shardKeys,"b!");
>     doQuery("c!doc2", "q","*:*", shardKeys,"c!");
> -    doQuery("d!doc3,f1!f2!doc5", "q","*:*", shardKeys,"d!");
> +    doQuery("d!doc3,f1!f2!doc5,f1!f2!doc5/5", "q","*:*", shardKeys,"d!");
>     doQuery("e!doc4", "q","*:*", shardKeys,"e!");
> -    doQuery("f1!f2!doc5,d!doc3", "q","*:*", shardKeys,"f1/8!");
> +    doQuery("f1!f2!doc5,d!doc3,f1!f2!doc5/5", "q","*:*", shardKeys,"f1/8!");
> 
>     // try using shards parameter
>     doQuery("b!doc1", "q","*:*", "shards",bucket1);
>     doQuery("c!doc2", "q","*:*", "shards",bucket2);
> -    doQuery("d!doc3,f1!f2!doc5", "q","*:*", "shards",bucket3);
> +    doQuery("d!doc3,f1!f2!doc5,f1!f2!doc5/5", "q","*:*", "shards",bucket3);
>     doQuery("e!doc4", "q","*:*", "shards",bucket4);
> 
> 
> @@ -181,16 +184,16 @@ public class ShardRoutingTest extends Ab
>     doQuery("b!doc1,c!doc2", "q","*:*", shardKeys,"b,c");     // query shards that would
contain *documents* "b" and "c" (i.e. not prefixes).  The upper bits are the same, so the
shards should be the same.
> 
>     doQuery("b!doc1,c!doc2", "q","*:*", shardKeys,"b/1!");   // top bit of hash(b)==1,
so shard1 and shard2
> -    doQuery("d!doc3,e!doc4,f1!f2!doc5", "q","*:*", shardKeys,"d/1!");   // top bit of
hash(b)==0, so shard3 and shard4
> +    doQuery("d!doc3,e!doc4,f1!f2!doc5,f1!f2!doc5/5", "q","*:*", shardKeys,"d/1!"); 
 // top bit of hash(b)==0, so shard3 and shard4
> 
>     doQuery("b!doc1,c!doc2", "q","*:*", shardKeys,"b!,c!");
> 
> -    doQuery("b!doc1,f1!f2!doc5,c!doc2,d!doc3,e!doc4", "q","*:*", shardKeys,"foo/0!");
> +    doQuery("b!doc1,f1!f2!doc5,c!doc2,d!doc3,e!doc4,f1!f2!doc5/5", "q","*:*", shardKeys,"foo/0!");
> 
>     // test targeting deleteByQuery at only certain shards
>     doDBQ("*:*", shardKeys,"b!");
>     commit();
> -    doQuery("c!doc2,d!doc3,e!doc4,f1!f2!doc5", "q","*:*");
> +    doQuery("c!doc2,d!doc3,e!doc4,f1!f2!doc5,f1!f2!doc5/5", "q","*:*");
>     doAddDoc("b!doc1");
> 
>     doDBQ("*:*", shardKeys,"f1!");
> 
> Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java?rev=1547452&r1=1547451&r2=1547452&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
(original)
> +++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java
Tue Dec  3 16:10:58 2013
> @@ -143,7 +143,6 @@ public class TriLevelCompositeIdRoutingT
>   Set<String> doQueryGetUniqueIdKeys(String... queryParams) throws Exception {
>     QueryResponse rsp = cloudClient.query(params(queryParams));
>     Set<String> obtainedIdKeys = new HashSet<String>();
> -    Set<String> obtainedIdKeys2 = new HashSet<String>();
>     for (SolrDocument doc : rsp.getResults()) {
>       obtainedIdKeys.add(getKey((String) doc.get("id")));
>     }
> 
> Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java?rev=1547452&r1=1547451&r2=1547452&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java
(original)
> +++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/CompositeIdRouter.java
Tue Dec  3 16:10:58 2013
> @@ -202,15 +202,16 @@ public class CompositeIdRouter extends H
>       } else {
>         numBits[0] = 16;
>         triLevel = false;
> -
>       }
> 
>       for (int i = 0; i < parts.length; i++) {
> -        int commaIdx = parts[i].indexOf(bitsSeparator);
> +        if (i < pieces - 1) {
> +          int commaIdx = parts[i].indexOf(bitsSeparator);
> 
> -        if (commaIdx > 0) {
> -          numBits[i] = getNumBits(parts[i], commaIdx);
> -          parts[i] = parts[i].substring(0, commaIdx);
> +          if (commaIdx > 0) {
> +            numBits[i] = getNumBits(parts[i], commaIdx);
> +            parts[i] = parts[i].substring(0, commaIdx);
> +          }
>         }
>         hashes[i] = Hash.murmurhash3_x86_32(parts[i], 0, parts[i].length(), 0);
>       }
> 
> 


Mime
View raw message