diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index b0c4c2f7028..8679f689d8d 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -852,6 +852,12 @@ Bug fixes TermAllGroupsCollector or TermAllGroupHeadsCollector if instantiated with a non default small size. (Martijn van Groningen, yonik) +* LUCENE-3727: When writing stored fields and term vectors, Lucene + checks file sizes to detect a bug in some Sun JREs (LUCENE-1282), + however, on some NFS filesystems File.length() could be stale, + resulting in false errors like "fdx size mismatch while indexing". + These checks now use getFilePointer instead to avoid this. + (Jamir Shaikh, Mike McCandless, Robert Muir) Optimizations diff --git a/lucene/src/java/org/apache/lucene/index/CompositeReader.java b/lucene/src/java/org/apache/lucene/index/CompositeReader.java index 2c0d161ca05..fcb192f241f 100644 --- a/lucene/src/java/org/apache/lucene/index/CompositeReader.java +++ b/lucene/src/java/org/apache/lucene/index/CompositeReader.java @@ -22,7 +22,7 @@ import java.io.IOException; import org.apache.lucene.index.AtomicReader.AtomicReaderContext; import org.apache.lucene.search.SearcherManager; // javadocs import org.apache.lucene.store.*; -import org.apache.lucene.util.ReaderUtil; // for javadocs +import org.apache.lucene.util.ReaderUtil; /** IndexReader is an abstract class, providing an interface for accessing an index. Search of an index is done entirely through this abstract interface, diff --git a/lucene/src/java/org/apache/lucene/util/fst/Builder.java b/lucene/src/java/org/apache/lucene/util/fst/Builder.java index 606a4b90641..fbda31bb99f 100644 --- a/lucene/src/java/org/apache/lucene/util/fst/Builder.java +++ b/lucene/src/java/org/apache/lucene/util/fst/Builder.java @@ -78,7 +78,8 @@ public class Builder { /** * Instantiates an FST/FSA builder without any pruning. A shortcut - * to {@link #Builder(FST.INPUT_TYPE, int, int, boolean, boolean, int, Outputs, FreezeTail)} with + * to {@link #Builder(FST.INPUT_TYPE, int, int, boolean, + * boolean, int, Outputs, FreezeTail, boolean)} with * pruning options turned off. */ public Builder(FST.INPUT_TYPE inputType, Outputs outputs) { @@ -122,9 +123,10 @@ public class Builder { * FSA, use {@link NoOutputs#getSingleton()} and {@link NoOutputs#getNoOutput()} as the * singleton output object. * - * @param willPackFST Pass true if you will rewrite (compact) the FST before saving. This - * causes the FST to create additional data structures intenrally to facilitate rewriting, but - * it means the resulting FST cannot be saved: it must first be rewritten using {@link FST#FST(FST,int[])}} + * @param willPackFST Pass true if you will pack the FST before saving. This + * causes the FST to create additional data structures internally to facilitate packing, but + * it means the resulting FST cannot be saved: it must + * first be packed using {@link FST#pack(int, int)}}. */ public Builder(FST.INPUT_TYPE inputType, int minSuffixCount1, int minSuffixCount2, boolean doShareSuffix, boolean doShareNonSingletonNodes, int shareMaxTailLength, Outputs outputs, diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java index ac6488394e0..34f54679fc9 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkey.java @@ -19,7 +19,6 @@ package org.apache.solr.cloud; import java.net.BindException; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Random; @@ -297,13 +296,7 @@ public class ChaosMonkey { JettySolrRunner jetty; if (chance <= 5 && aggressivelyKillLeaders) { // if killLeader, really aggressively go after leaders - Collection leaders = shardToLeaderJetty.values(); - List leadersList = new ArrayList(leaders.size()); - - leadersList.addAll(leaders); - - int index = random.nextInt(leadersList.size()); - jetty = leadersList.get(index).jetty; + jetty = shardToLeaderJetty.get(slice).jetty; } else { // get random shard List jetties = shardToJetty.get(slice);