You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2013/07/04 01:26:45 UTC

svn commit: r1499601 [15/20] - in /lucene/dev/branches/security: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/ dev-tools/idea/solr/core/src/test/ dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/maven/lucene/analysis/stempel/ dev-t...

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/UpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/UpdateLog.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/UpdateLog.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/UpdateLog.java Wed Jul  3 23:26:32 2013
@@ -17,15 +17,38 @@
 
 package org.apache.solr.update;
 
+import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase.FROMLEADER;
+import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.Future;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.ExecutorUtil;
-import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.LocalSolrQueryRequest;
@@ -34,9 +57,6 @@ import org.apache.solr.request.SolrReque
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.update.processor.DistributedUpdateProcessor;
-import org.apache.solr.update.processor.DistributedUpdateProcessorFactory;
-import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
-import org.apache.solr.update.processor.RunUpdateProcessorFactory;
 import org.apache.solr.update.processor.UpdateRequestProcessor;
 import org.apache.solr.update.processor.UpdateRequestProcessorChain;
 import org.apache.solr.util.DefaultSolrThreadFactory;
@@ -45,15 +65,6 @@ import org.apache.solr.util.plugin.Plugi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
-import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase.FROMLEADER;
-
 
 /** @lucene.experimental */
 public class UpdateLog implements PluginInfoInitialized {
@@ -64,6 +75,10 @@ public class UpdateLog implements Plugin
   public boolean debug = log.isDebugEnabled();
   public boolean trace = log.isTraceEnabled();
 
+  // TODO: hack
+  public FileSystem getFs() {
+    return null;
+  }
 
   public enum SyncLevel { NONE, FLUSH, FSYNC;
     public static SyncLevel getSyncLevel(String level){
@@ -108,27 +123,27 @@ public class UpdateLog implements Plugin
   }
 
   long id = -1;
-  private State state = State.ACTIVE;
-  private int operationFlags;  // flags to write in the transaction log with operations (i.e. FLAG_GAP)
+  protected State state = State.ACTIVE;
+  protected int operationFlags;  // flags to write in the transaction log with operations (i.e. FLAG_GAP)
 
-  private TransactionLog tlog;
-  private TransactionLog prevTlog;
-  private Deque<TransactionLog> logs = new LinkedList<TransactionLog>();  // list of recent logs, newest first
-  private LinkedList<TransactionLog> newestLogsOnStartup = new LinkedList<TransactionLog>();
-  private int numOldRecords;  // number of records in the recent logs
-
-  private Map<BytesRef,LogPtr> map = new HashMap<BytesRef, LogPtr>();
-  private Map<BytesRef,LogPtr> prevMap;  // used while committing/reopening is happening
-  private Map<BytesRef,LogPtr> prevMap2;  // used while committing/reopening is happening
-  private TransactionLog prevMapLog;  // the transaction log used to look up entries found in prevMap
-  private TransactionLog prevMapLog2;  // the transaction log used to look up entries found in prevMap
+  protected TransactionLog tlog;
+  protected TransactionLog prevTlog;
+  protected Deque<TransactionLog> logs = new LinkedList<TransactionLog>();  // list of recent logs, newest first
+  protected LinkedList<TransactionLog> newestLogsOnStartup = new LinkedList<TransactionLog>();
+  protected int numOldRecords;  // number of records in the recent logs
+
+  protected Map<BytesRef,LogPtr> map = new HashMap<BytesRef, LogPtr>();
+  protected Map<BytesRef,LogPtr> prevMap;  // used while committing/reopening is happening
+  protected Map<BytesRef,LogPtr> prevMap2;  // used while committing/reopening is happening
+  protected TransactionLog prevMapLog;  // the transaction log used to look up entries found in prevMap
+  protected TransactionLog prevMapLog2;  // the transaction log used to look up entries found in prevMap
 
-  private final int numDeletesToKeep = 1000;
-  private final int numDeletesByQueryToKeep = 100;
+  protected final int numDeletesToKeep = 1000;
+  protected final int numDeletesByQueryToKeep = 100;
   public final int numRecordsToKeep = 100;
 
   // keep track of deletes only... this is not updated on an add
-  private LinkedHashMap<BytesRef, LogPtr> oldDeletes = new LinkedHashMap<BytesRef, LogPtr>(numDeletesToKeep) {
+  protected LinkedHashMap<BytesRef, LogPtr> oldDeletes = new LinkedHashMap<BytesRef, LogPtr>(numDeletesToKeep) {
     @Override
     protected boolean removeEldestEntry(Map.Entry eldest) {
       return size() > numDeletesToKeep;
@@ -145,21 +160,21 @@ public class UpdateLog implements Plugin
     }
   }
 
-  private LinkedList<DBQ> deleteByQueries = new LinkedList<DBQ>();
+  protected LinkedList<DBQ> deleteByQueries = new LinkedList<DBQ>();
 
-  private String[] tlogFiles;
-  private File tlogDir;
-  private Collection<String> globalStrings;
+  protected String[] tlogFiles;
+  protected File tlogDir;
+  protected Collection<String> globalStrings;
 
-  private String dataDir;
-  private String lastDataDir;
+  protected String dataDir;
+  protected String lastDataDir;
 
-  private VersionInfo versionInfo;
+  protected VersionInfo versionInfo;
 
-  private SyncLevel defaultSyncLevel = SyncLevel.FLUSH;
+  protected SyncLevel defaultSyncLevel = SyncLevel.FLUSH;
 
   volatile UpdateHandler uhandler;    // a core reload can change this reference!
-  private volatile boolean cancelApplyBufferUpdate;
+  protected volatile boolean cancelApplyBufferUpdate;
   List<Long> startingVersions;
   int startingOperation;  // last operation in the logs on startup
 
@@ -189,13 +204,17 @@ public class UpdateLog implements Plugin
     defaultSyncLevel = SyncLevel.getSyncLevel((String)info.initArgs.get("syncLevel"));
   }
 
+  /* Note, when this is called, uhandler is not completely constructed.
+   * This must be called when a new log is created, or
+   * for an existing log whenever the core or update handler changes.
+   */
   public void init(UpdateHandler uhandler, SolrCore core) {
     // ulogDir from CoreDescriptor overrides
     String ulogDir = core.getCoreDescriptor().getUlogDir();
     if (ulogDir != null) {
       dataDir = ulogDir;
     }
-    
+
     if (dataDir == null || dataDir.length()==0) {
       dataDir = core.getDataDir();
     }
@@ -276,8 +295,8 @@ public class UpdateLog implements Plugin
 
   }
   
-  public File getLogDir() {
-    return tlogDir;
+  public String getLogDir() {
+    return tlogDir.getAbsolutePath();
   }
   
   public List<Long> getStartingVersions() {
@@ -291,7 +310,7 @@ public class UpdateLog implements Plugin
   /* Takes over ownership of the log, keeping it until no longer needed
      and then decrementing it's reference and dropping it.
    */
-  private void addOldLog(TransactionLog oldLog, boolean removeOld) {
+  protected void addOldLog(TransactionLog oldLog, boolean removeOld) {
     if (oldLog == null) return;
 
     numOldRecords += oldLog.numRecords();
@@ -322,7 +341,7 @@ public class UpdateLog implements Plugin
   }
 
 
-  public static String[] getLogList(File directory) {
+  public String[] getLogList(File directory) {
     final String prefix = TLOG_NAME+'.';
     String[] names = directory.list(new FilenameFilter() {
       @Override
@@ -330,6 +349,9 @@ public class UpdateLog implements Plugin
         return name.startsWith(prefix);
       }
     });
+    if (names == null) {
+      throw new RuntimeException(new FileNotFoundException(directory.getAbsolutePath()));
+    }
     Arrays.sort(names);
     return names;
   }
@@ -540,7 +562,7 @@ public class UpdateLog implements Plugin
     }
   }
 
-  private void newMap() {
+  protected void newMap() {
     prevMap2 = prevMap;
     prevMapLog2 = prevMapLog;
 
@@ -793,7 +815,7 @@ public class UpdateLog implements Plugin
   }
 
 
-  private void ensureLog() {
+  protected void ensureLog() {
     if (tlog == null) {
       String newLogName = String.format(Locale.ROOT, LOG_FILENAME_PATTERN, TLOG_NAME, id);
       tlog = new TransactionLog(new File(tlogDir, newLogName), globalStrings);
@@ -968,6 +990,8 @@ public class UpdateLog implements Plugin
               log.warn("Exception reverse reading log", ex);
               break;
             }
+
+            numUpdates++;
           }
 
         } catch (IOException e) {
@@ -1139,7 +1163,7 @@ public class UpdateLog implements Plugin
 
 
 
-  private RecoveryInfo recoveryInfo;
+  protected RecoveryInfo recoveryInfo;
 
   class LogReplayer implements Runnable {
     private Logger loglog = log;  // set to something different?
@@ -1416,7 +1440,7 @@ public class UpdateLog implements Plugin
     }
   }
   
-  public static File getTlogDir(SolrCore core, PluginInfo info) {
+  protected String getTlogDir(SolrCore core, PluginInfo info) {
     String dataDir = (String) info.initArgs.get("dir");
     
     String ulogDir = core.getCoreDescriptor().getUlogDir();
@@ -1427,11 +1451,30 @@ public class UpdateLog implements Plugin
     if (dataDir == null || dataDir.length() == 0) {
       dataDir = core.getDataDir();
     }
-    
-    return new File(dataDir, TLOG_NAME);
+
+    return dataDir + "/" + TLOG_NAME;
+  }
+  
+  /**
+   * Clears the logs on the file system. Only call before init.
+   * 
+   * @param core the SolrCore
+   * @param ulogPluginInfo the init info for the UpdateHandler
+   */
+  public void clearLog(SolrCore core, PluginInfo ulogPluginInfo) {
+    if (ulogPluginInfo == null) return;
+    File tlogDir = new File(getTlogDir(core, ulogPluginInfo));
+    if (tlogDir.exists()) {
+      String[] files = getLogList(tlogDir);
+      for (String file : files) {
+        File f = new File(tlogDir, file);
+        boolean s = f.delete();
+        if (!s) {
+          log.error("Could not remove tlog file:" + f);
+        }
+      }
+    }
   }
   
 }
 
-
-

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java Wed Jul  3 23:26:32 2013
@@ -195,25 +195,13 @@ public class CloneFieldUpdateProcessorFa
     
     srcSelector = 
       FieldMutatingUpdateProcessor.createFieldNameSelector
-      (core.getResourceLoader(),
-       core,
-       srcInclusions.fieldName,
-       srcInclusions.typeName,
-       srcInclusions.typeClass,
-       srcInclusions.fieldRegex,
-       FieldMutatingUpdateProcessor.SELECT_NO_FIELDS);
+          (core.getResourceLoader(), core, srcInclusions, FieldMutatingUpdateProcessor.SELECT_NO_FIELDS);
 
     for (SelectorParams exc : srcExclusions) {
       srcSelector = FieldMutatingUpdateProcessor.wrap
         (srcSelector,
          FieldMutatingUpdateProcessor.createFieldNameSelector
-         (core.getResourceLoader(),
-          core,
-          exc.fieldName,
-          exc.typeName,
-          exc.typeClass,
-          exc.fieldRegex,
-          FieldMutatingUpdateProcessor.SELECT_NO_FIELDS));
+             (core.getResourceLoader(), core, exc, FieldMutatingUpdateProcessor.SELECT_NO_FIELDS));
     }
   }
 

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Wed Jul  3 23:26:32 2013
@@ -222,9 +222,9 @@ public class DistributedUpdateProcessor 
         // Replica leader = slice.getLeader();
         Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(
             collection, shardId);
-        ZkCoreNodeProps leaderProps = new ZkCoreNodeProps(leaderReplica);
-        String coreNodeName = zkController.getCoreNodeName(req.getCore().getCoreDescriptor());
-        isLeader = coreNodeName.equals(leaderReplica.getName());
+        isLeader = leaderReplica.getName().equals(
+            req.getCore().getCoreDescriptor().getCloudDescriptor()
+                .getCoreNodeName());
 
         DistribPhase phase =
             DistribPhase.parseParam(req.getParams().get(DISTRIB_UPDATE_PARAM));
@@ -240,10 +240,9 @@ public class DistributedUpdateProcessor 
           // so get the replicas...
           forwardToLeader = false;
           List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()
-              .getReplicaProps(collection, shardId, coreNodeName,
+              .getReplicaProps(collection, shardId, leaderReplica.getName(),
                   coreName, null, ZkStateReader.DOWN);
 
-          nodes = addSubShardLeaders(coll, shardId, id, doc, nodes);
           if (replicaProps != null) {
             if (nodes == null)  {
             nodes = new ArrayList<Node>(replicaProps.size());
@@ -273,7 +272,7 @@ public class DistributedUpdateProcessor 
         } else {
           // I need to forward onto the leader...
           nodes = new ArrayList<Node>(1);
-          nodes.add(new RetryNode(leaderProps, zkController.getZkStateReader(), collection, shardId));
+          nodes.add(new RetryNode(new ZkCoreNodeProps(leaderReplica), zkController.getZkStateReader(), collection, shardId));
           forwardToLeader = true;
         }
 
@@ -287,8 +286,9 @@ public class DistributedUpdateProcessor 
     return nodes;
   }
 
-  private List<Node> addSubShardLeaders(DocCollection coll, String shardId, String docId, SolrInputDocument doc, List<Node> nodes) {
+  private List<Node> getSubShardLeaders(DocCollection coll, String shardId, String docId, SolrInputDocument doc) {
     Collection<Slice> allSlices = coll.getSlices();
+    List<Node> nodes = null;
     for (Slice aslice : allSlices) {
       if (Slice.CONSTRUCTION.equals(aslice.getState()))  {
         DocRouter.Range myRange = coll.getSlice(shardId).getRange();
@@ -343,7 +343,9 @@ public class DistributedUpdateProcessor 
 
     if (isLeader && !localIsLeader) {
       log.error("ClusterState says we are the leader, but locally we don't think so");
-      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "ClusterState says we are the leader, but locally we don't think so");
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE,
+          "ClusterState says we are the leader (" + zkController.getBaseUrl()
+              + "/" + req.getCore().getName() + "), but locally we don't think so. Request came from " + from);
     }
   }
 
@@ -356,16 +358,15 @@ public class DistributedUpdateProcessor 
     try {
       Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(
           collection, shardId);
-      String leaderCoreNodeName = leaderReplica.getName();
-
-      String coreNodeName = zkController.getCoreNodeName(req.getCore().getCoreDescriptor());
-      isLeader = coreNodeName.equals(leaderCoreNodeName);
+      isLeader = leaderReplica.getName().equals(
+          req.getCore().getCoreDescriptor().getCloudDescriptor()
+              .getCoreNodeName());
 
       // TODO: what if we are no longer the leader?
 
       forwardToLeader = false;
       List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()
-          .getReplicaProps(collection, shardId, coreNodeName,
+          .getReplicaProps(collection, shardId, leaderReplica.getName(),
               req.getCore().getName());
       if (replicaProps != null) {
         nodes = new ArrayList<Node>(replicaProps.size());
@@ -373,8 +374,6 @@ public class DistributedUpdateProcessor 
           nodes.add(new StdNode(props));
         }
       }
-
-      nodes = addSubShardLeaders(zkController.getClusterState().getCollection(collection), shardId, null, null, nodes);
     } catch (InterruptedException e) {
       Thread.currentThread().interrupt();
       throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "",
@@ -395,7 +394,7 @@ public class DistributedUpdateProcessor 
     } else {
       isLeader = getNonZkLeaderAssumption(req);
     }
-    
+
     boolean dropCmd = false;
     if (!forwardToLeader) {
       dropCmd = versionAdd(cmd);
@@ -405,22 +404,35 @@ public class DistributedUpdateProcessor 
       // TODO: do we need to add anything to the response?
       return;
     }
-    
+
+    if (zkEnabled && isLeader)  {
+      DocCollection coll = zkController.getClusterState().getCollection(collection);
+      List<Node> subShardLeaders = getSubShardLeaders(coll, cloudDesc.getShardId(), cmd.getHashableId(), cmd.getSolrInputDocument());
+      // the list<node> will actually have only one element for an add request
+      if (subShardLeaders != null && !subShardLeaders.isEmpty()) {
+        ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
+        params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
+        params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
+            zkController.getBaseUrl(), req.getCore().getName()));
+        params.set("distrib.from.parent", req.getCore().getCoreDescriptor().getCloudDescriptor().getShardId());
+        for (Node subShardLeader : subShardLeaders) {
+          cmdDistrib.syncAdd(cmd, subShardLeader, params);
+        }
+      }
+    }
+
     ModifiableSolrParams params = null;
     if (nodes != null) {
-      
+
       params = new ModifiableSolrParams(filterParams(req.getParams()));
-      params.set(DISTRIB_UPDATE_PARAM, 
-                 (isLeader ? 
-                  DistribPhase.FROMLEADER.toString() : 
+      params.set(DISTRIB_UPDATE_PARAM,
+                 (isLeader ?
+                  DistribPhase.FROMLEADER.toString() :
                   DistribPhase.TOLEADER.toString()));
       if (isLeader) {
         params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
             zkController.getBaseUrl(), req.getCore().getName()));
       }
-      if (forwardToSubShard)  {
-        params.set("distrib.from.parent", req.getCore().getCoreDescriptor().getCloudDescriptor().getShardId());
-      }
 
       params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
           zkController.getBaseUrl(), req.getCore().getName()));
@@ -640,7 +652,7 @@ public class DistributedUpdateProcessor 
         if (willDistrib) {
           clonedDoc = cmd.solrDoc.deepCopy();
         }
-        
+
         // TODO: possibly set checkDeleteByQueries as a flag on the command?
         doLocalAdd(cmd);
         
@@ -781,13 +793,28 @@ public class DistributedUpdateProcessor 
       return;
     }
 
+    if (zkEnabled && isLeader)  {
+      DocCollection coll = zkController.getClusterState().getCollection(collection);
+      List<Node> subShardLeaders = getSubShardLeaders(coll, cloudDesc.getShardId(), null, null);
+      // the list<node> will actually have only one element for an add request
+      if (subShardLeaders != null && !subShardLeaders.isEmpty()) {
+        ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
+        params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
+        params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
+            zkController.getBaseUrl(), req.getCore().getName()));
+        params.set("distrib.from.parent", cloudDesc.getShardId());
+        cmdDistrib.syncDelete(cmd, subShardLeaders, params);
+      }
+    }
+
+
     ModifiableSolrParams params = null;
     if (nodes != null) {
-      
+
       params = new ModifiableSolrParams(filterParams(req.getParams()));
-      params.set(DISTRIB_UPDATE_PARAM, 
-                 (isLeader ? 
-                  DistribPhase.FROMLEADER.toString() : 
+      params.set(DISTRIB_UPDATE_PARAM,
+                 (isLeader ?
+                  DistribPhase.FROMLEADER.toString() :
                   DistribPhase.TOLEADER.toString()));
       if (isLeader) {
         params.set("distrib.from", ZkCoreNodeProps.getCoreUrl(
@@ -817,9 +844,11 @@ public class DistributedUpdateProcessor 
   }
 
   private void passParam(SolrParams params, ModifiableSolrParams fparams, String param) {
-    String value = params.get(param);
-    if (value != null) {
-      fparams.add(param, value);
+    String[] values = params.getParams(param);
+    if (values != null) {
+      for (String value : values) {
+        fparams.add(param, value);
+      }
     }
   }
 
@@ -843,13 +872,15 @@ public class DistributedUpdateProcessor 
     DistribPhase phase = 
     DistribPhase.parseParam(req.getParams().get(DISTRIB_UPDATE_PARAM));
 
+    DocCollection coll = zkEnabled 
+      ? zkController.getClusterState().getCollection(collection) : null;
+
     if (zkEnabled && DistribPhase.NONE == phase) {
       boolean leaderForAnyShard = false;  // start off by assuming we are not a leader for any shard
 
       ModifiableSolrParams outParams = new ModifiableSolrParams(filterParams(req.getParams()));
       outParams.set(DISTRIB_UPDATE_PARAM, DistribPhase.TOLEADER.toString());
 
-      DocCollection coll = zkController.getClusterState().getCollection(collection);
       SolrParams params = req.getParams();
       Collection<Slice> slices = coll.getRouter().getSearchSlices(params.get(ShardParams.SHARD_KEYS), params, coll);
 
@@ -869,7 +900,7 @@ public class DistributedUpdateProcessor 
         // Am I the leader for this slice?
         ZkCoreNodeProps coreLeaderProps = new ZkCoreNodeProps(leader);
         String leaderCoreNodeName = leader.getName();
-        String coreNodeName = zkController.getCoreNodeName(req.getCore().getCoreDescriptor());
+        String coreNodeName = req.getCore().getCoreDescriptor().getCloudDescriptor().getCoreNodeName();
         isLeader = coreNodeName.equals(leaderCoreNodeName);
 
         if (isLeader) {
@@ -957,16 +988,22 @@ public class DistributedUpdateProcessor 
       vinfo.unblockUpdates();
     }
 
-
     // forward to all replicas
-    if (leaderLogic && replicas != null) {
+    if (leaderLogic && zkEnabled) {
+      List<Node> subShardLeaders = getSubShardLeaders(coll, cloudDesc.getShardId(), null, null);
+
       ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
       params.set(VERSION_FIELD, Long.toString(cmd.getVersion()));
       params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
       params.set("update.from", ZkCoreNodeProps.getCoreUrl(
           zkController.getBaseUrl(), req.getCore().getName()));
-      cmdDistrib.distribDelete(cmd, replicas, params);
-      cmdDistrib.finish();
+      if (subShardLeaders != null)  {
+        cmdDistrib.syncDelete(cmd, subShardLeaders, params);
+      }
+      if (replicas != null) {
+        cmdDistrib.distribDelete(cmd, replicas, params);
+        cmdDistrib.finish();
+      }
     }
 
 
@@ -1097,15 +1134,37 @@ public class DistributedUpdateProcessor 
     }
   }
 
-
   @Override
   public void processCommit(CommitUpdateCommand cmd) throws IOException {
     updateCommand = cmd;
-
+    List<Node> nodes = null;
+    boolean singleLeader = false;
     if (zkEnabled) {
       zkCheck();
+      
+      nodes = getCollectionUrls(req, req.getCore().getCoreDescriptor()
+          .getCloudDescriptor().getCollectionName());
+      if (isLeader && nodes.size() == 1) {
+        singleLeader = true;
+      }
     }
     
+    if (!zkEnabled || req.getParams().getBool(COMMIT_END_POINT, false) || singleLeader) {
+      doLocalCommit(cmd);
+    } else if (zkEnabled) {
+      ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
+      if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
+        params.set(COMMIT_END_POINT, true);
+
+        if (nodes != null) {
+          cmdDistrib.distribCommit(cmd, nodes, params);
+          finish();
+        }
+      }
+    }
+  }
+
+  private void doLocalCommit(CommitUpdateCommand cmd) throws IOException {
     if (vinfo != null) {
       vinfo.lockForUpdate();
     }
@@ -1122,23 +1181,6 @@ public class DistributedUpdateProcessor 
         vinfo.unlockForUpdate();
       }
     }
-    // TODO: we should consider this? commit everyone in the current collection
-
-    if (zkEnabled) {
-      ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
-      if (!req.getParams().getBool(COMMIT_END_POINT, false)) {
-        params.set(COMMIT_END_POINT, true);
-
-        String coreNodeName = zkController.getCoreNodeName(req.getCore().getCoreDescriptor());
-        List<Node> nodes = getCollectionUrls(req, req.getCore().getCoreDescriptor()
-            .getCloudDescriptor().getCollectionName(), coreNodeName);
-
-        if (nodes != null) {
-          cmdDistrib.distribCommit(cmd, nodes, params);
-          finish();
-        }
-      }
-    }
   }
   
   @Override
@@ -1150,7 +1192,7 @@ public class DistributedUpdateProcessor 
  
 
   
-  private List<Node> getCollectionUrls(SolrQueryRequest req, String collection, String coreNodeName) {
+  private List<Node> getCollectionUrls(SolrQueryRequest req, String collection) {
     ClusterState clusterState = req.getCore().getCoreDescriptor()
         .getCoreContainer().getZkController().getClusterState();
     List<Node> urls = new ArrayList<Node>();
@@ -1166,7 +1208,7 @@ public class DistributedUpdateProcessor 
       
       for (Entry<String,Replica> entry : shardMap.entrySet()) {
         ZkCoreNodeProps nodeProps = new ZkCoreNodeProps(entry.getValue());
-        if (clusterState.liveNodesContain(nodeProps.getNodeName()) && !entry.getKey().equals(coreNodeName)) {
+        if (clusterState.liveNodesContain(nodeProps.getNodeName())) {
           urls.add(new StdNode(nodeProps));
         }
       }

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java Wed Jul  3 23:26:32 2013
@@ -20,11 +20,11 @@ package org.apache.solr.update.processor
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Set;
 import java.util.regex.Pattern;
 
 import static org.apache.solr.common.SolrException.ErrorCode.BAD_REQUEST;
 import static org.apache.solr.common.SolrException.ErrorCode.SERVER_ERROR;
+import static org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory.SelectorParams;
 
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.SolrInputField;
@@ -108,7 +108,7 @@ public abstract class FieldMutatingUpdat
         // for now, don't allow it.
         if (! fname.equals(dest.getName()) ) {
           throw new SolrException(SERVER_ERROR,
-                                  "mutute returned field with different name: " 
+                                  "mutate returned field with different name: " 
                                   + fname + " => " + dest.getName());
         }
         doc.put(dest.getName(), dest);
@@ -118,7 +118,7 @@ public abstract class FieldMutatingUpdat
   }
   
   /**
-   * Interface for idenfifying which fileds should be mutated
+   * Interface for identifying which fields should be mutated
    */
   public static interface FieldNameSelector {
     public boolean shouldMutate(final String fieldName);
@@ -192,79 +192,75 @@ public abstract class FieldMutatingUpdat
   public static FieldNameSelector createFieldNameSelector
     (final SolrResourceLoader loader,
      final SolrCore core,
-     final Set<String> fields,
-     final Set<String> typeNames,
-     final Collection<String> typeClasses,
-     final Collection<Pattern> regexes,
+     final SelectorParams params,
      final FieldNameSelector defSelector) {
-    
-    final Collection<Class> classes 
-      = new ArrayList<Class>(typeClasses.size());
-    
-    for (String t : typeClasses) {
-      try {
-        classes.add(loader.findClass(t, Object.class));
-      } catch (Exception e) {
-        throw new SolrException(SERVER_ERROR,
-                                "Can't resolve typeClass: " + t, e);
-      }
-    }
-    
-    if (classes.isEmpty() && 
-        typeNames.isEmpty() && 
-        regexes.isEmpty() && 
-        fields.isEmpty()) {
+
+    if (params.noSelectorsSpecified()) {
       return defSelector;
     }
     
-    return new ConfigurableFieldNameSelector(core, fields, typeNames, classes, regexes); 
+    return new ConfigurableFieldNameSelector(loader, core, params); 
   }
   
+  
+  
   private static final class ConfigurableFieldNameSelector 
     implements FieldNameSelector {
 
     final SolrCore core;
-    final Set<String> fields;
-    final Set<String> typeNames;
+    final SelectorParams params;
     final Collection<Class> classes;
-    final Collection<Pattern> regexes;
 
-    private ConfigurableFieldNameSelector(final SolrCore core,
-                                          final Set<String> fields,
-                                          final Set<String> typeNames,
-                                          final Collection<Class> classes,
-                                          final Collection<Pattern> regexes) {
+    private ConfigurableFieldNameSelector(final SolrResourceLoader loader,
+                                          final SolrCore core,
+                                          final SelectorParams params) {
       this.core = core;
-      this.fields = fields;
-      this.typeNames = typeNames;
+      this.params = params;
+
+      final Collection<Class> classes = new ArrayList<Class>(params.typeClass.size());
+
+      for (String t : params.typeClass) {
+        try {
+          classes.add(loader.findClass(t, Object.class));
+        } catch (Exception e) {
+          throw new SolrException(SERVER_ERROR, "Can't resolve typeClass: " + t, e);
+        }
+      }
       this.classes = classes;
-      this.regexes = regexes;
     }
 
     @Override
     public boolean shouldMutate(final String fieldName) {
       
-      // order of checks is bsaed on what should be quicker 
+      // order of checks is based on what should be quicker
       // (ie: set lookups faster the looping over instanceOf / matches tests
       
-      if ( ! (fields.isEmpty() || fields.contains(fieldName)) ) {
+      if ( ! (params.fieldName.isEmpty() || params.fieldName.contains(fieldName)) ) {
         return false;
       }
       
       // do not consider it an error if the fieldName has no type
       // there might be another processor dealing with it later
       FieldType t =  core.getLatestSchema().getFieldTypeNoEx(fieldName);
-      if (null != t) {
-        if (! (typeNames.isEmpty() || typeNames.contains(t.getTypeName())) ) {
+      final boolean fieldExists = (null != t);
+
+      if ( (null != params.fieldNameMatchesSchemaField) &&
+           (fieldExists != params.fieldNameMatchesSchemaField) ) {
+        return false;
+      }
+
+      if (fieldExists) { 
+
+        if (! (params.typeName.isEmpty() || params.typeName.contains(t.getTypeName())) ) {
           return false;
         }
         
         if (! (classes.isEmpty() || instanceOfAny(t, classes)) ) {
           return false;
-          }
-      }
+        }
+      } 
       
-      if (! (regexes.isEmpty() || matchesAny(fieldName, regexes)) ) {
+      if (! (params.fieldRegex.isEmpty() || matchesAny(fieldName, params.fieldRegex)) ) {
         return false;
       }
       

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java Wed Jul  3 23:26:32 2013
@@ -58,6 +58,15 @@ import org.apache.solr.util.plugin.SolrC
  * <b>at least one of each</b> to be selected.
  * </p>
  * <p>
+ * The following additional selector may be specified as a &lt;bool&gt; - when specified
+ * as false, only fields that <b>do not</b> match a schema field/dynamic field are selected;
+ * when specified as true, only fields that <b>do</b> match a schema field/dynamic field are
+ * selected:
+ * </p>
+ * <ul>
+ *   <li><code>fieldNameMatchesSchemaField</code> - selecting specific fields based on whether or not they match a schema field</li>
+ * </ul>
+ * <p>
  * One or more <code>excludes</code> &lt;lst&gt; params may also be specified, 
  * containing any of the above criteria, identifying fields to be excluded 
  * from seelction even if they match the selection criteria.  As with the main 
@@ -71,7 +80,7 @@ import org.apache.solr.util.plugin.SolrC
  * fields will be mutated if the name starts with "foo" <i>or</i> "bar"; 
  * <b>unless</b> the field name contains the substring "SKIP" <i>or</i> 
  * the fieldType is (or subclasses) DateField.  Meaning a field named 
- * "foo_SKIP" is gaurunteed not to be selected, but a field named "bar_smith" 
+ * "foo_SKIP" is guaranteed not to be selected, but a field named "bar_smith" 
  * that uses StrField will be selected.
  * </p>
  * <pre class="prettyprint">
@@ -106,6 +115,13 @@ public abstract class FieldMutatingUpdat
     public Set<String> typeName = Collections.emptySet();
     public Collection<String> typeClass = Collections.emptyList();
     public Collection<Pattern> fieldRegex = Collections.emptyList();
+    public Boolean fieldNameMatchesSchemaField = null; // null => not specified
+
+    public boolean noSelectorsSpecified() {
+      return typeClass.isEmpty()  && typeName.isEmpty() 
+          && fieldRegex.isEmpty() && fieldName.isEmpty() 
+          && null == fieldNameMatchesSchemaField;
+    }
   }
 
   private SelectorParams inclusions = new SelectorParams();
@@ -121,7 +137,6 @@ public abstract class FieldMutatingUpdat
                             " inform(SolrCore) never called???");
   }
 
-  @SuppressWarnings("unchecked")
   public static SelectorParams parseSelectorParams(NamedList args) {
     SelectorParams params = new SelectorParams();
     
@@ -145,43 +160,52 @@ public abstract class FieldMutatingUpdat
     // resolve this into actual Class objects later
     params.typeClass = oneOrMany(args, "typeClass");
 
+    // getBooleanArg() returns null if the arg is not specified
+    params.fieldNameMatchesSchemaField = getBooleanArg(args, "fieldNameMatchesSchemaField");
+    
     return params;
   }
-                                                            
-
-  /**
-   * Handles common initialization related to source fields for 
-   * constructoring the FieldNameSelector to be used.
-   *
-   * Will error if any unexpected init args are found, so subclasses should
-   * remove any subclass-specific init args before calling this method.
-   */
-  @SuppressWarnings("unchecked")
-  @Override
-  public void init(NamedList args) {
-
-    inclusions = parseSelectorParams(args);
-
+                               
+  public static Collection<SelectorParams> parseSelectorExclusionParams(NamedList args) {
+    Collection<SelectorParams> exclusions = new ArrayList<SelectorParams>();
     List<Object> excList = args.getAll("exclude");
     for (Object excObj : excList) {
       if (null == excObj) {
         throw new SolrException
-          (SERVER_ERROR, "'exclude' init param can not be null"); 
+            (SERVER_ERROR, "'exclude' init param can not be null");
       }
       if (! (excObj instanceof NamedList) ) {
         throw new SolrException
-          (SERVER_ERROR, "'exclude' init param must be <lst/>"); 
+            (SERVER_ERROR, "'exclude' init param must be <lst/>");
       }
       NamedList exc = (NamedList) excObj;
       exclusions.add(parseSelectorParams(exc));
       if (0 < exc.size()) {
-        throw new SolrException(SERVER_ERROR, 
-                                "Unexpected 'exclude' init sub-param(s): '" + 
-                                args.getName(0) + "'");
+        throw new SolrException(SERVER_ERROR,
+            "Unexpected 'exclude' init sub-param(s): '" +
+                args.getName(0) + "'");
       }
       // call once per instance
       args.remove("exclude");
     }
+    return exclusions;
+  }
+  
+
+  /**
+   * Handles common initialization related to source fields for 
+   * constructing the FieldNameSelector to be used.
+   *
+   * Will error if any unexpected init args are found, so subclasses should
+   * remove any subclass-specific init args before calling this method.
+   */
+  @SuppressWarnings("unchecked")
+  @Override
+  public void init(NamedList args) {
+
+    inclusions = parseSelectorParams(args);
+    exclusions = parseSelectorExclusionParams(args);
+
     if (0 < args.size()) {
       throw new SolrException(SERVER_ERROR, 
                               "Unexpected init param(s): '" + 
@@ -195,25 +219,13 @@ public abstract class FieldMutatingUpdat
     
     selector = 
       FieldMutatingUpdateProcessor.createFieldNameSelector
-      (core.getResourceLoader(),
-       core,
-       inclusions.fieldName,
-       inclusions.typeName,
-       inclusions.typeClass,
-       inclusions.fieldRegex,
-       getDefaultSelector(core));
+          (core.getResourceLoader(), core, inclusions, getDefaultSelector(core));
 
     for (SelectorParams exc : exclusions) {
       selector = FieldMutatingUpdateProcessor.wrap
         (selector,
          FieldMutatingUpdateProcessor.createFieldNameSelector
-         (core.getResourceLoader(),
-          core,
-          exc.fieldName,
-          exc.typeName,
-          exc.typeClass,
-          exc.fieldRegex,
-          FieldMutatingUpdateProcessor.SELECT_NO_FIELDS));
+             (core.getResourceLoader(), core, exc, FieldMutatingUpdateProcessor.SELECT_NO_FIELDS));
     }
   }
   
@@ -270,7 +282,28 @@ public abstract class FieldMutatingUpdat
     return result;
   }
 
+  /**
+   * Removes the first instance of the key from NamedList, returning the Boolean
+   * that key referred to, or null if the key is not specified.
+   * @exception SolrException invalid type or structure
+   */
+  public static Boolean getBooleanArg(final NamedList args, final String key) {
+    Boolean bool;
+    List values = args.getAll(key);
+    if (0 == values.size()) {
+      return null;
+    }
+    if (values.size() > 1) {
+      throw new SolrException(SERVER_ERROR, "Only one '" + key + "' is allowed");
+    }
+    Object o = args.remove(key);
+    if (o instanceof Boolean) {
+      bool = (Boolean)o;
+    } else if (o instanceof CharSequence) {
+      bool = Boolean.parseBoolean(o.toString());
+    } else {
+      throw new SolrException(SERVER_ERROR, "'" + key + "' must have type 'bool' or 'str'; found " + o.getClass());
+    }
+    return bool;
+  }
 }
-
-
-

Modified: lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java (original)
+++ lucene/dev/branches/security/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java Wed Jul  3 23:26:32 2013
@@ -34,23 +34,48 @@ import java.util.ArrayList;
 /**
  * Manages a chain of UpdateRequestProcessorFactories.
  * <p>
- * Chain can be configured via solrconfig.xml:
+ * Chains can be configured via solrconfig.xml using the following syntax...
  * </p>
  * <pre class="prettyprint">
- * &lt;updateRequestProcessors name="key" default="true"&gt;
- *   &lt;processor class="PathToClass1" /&gt;
- *   &lt;processor class="PathToClass2" /&gt;
+ * &lt;updateRequestProcessorChain name="key" default="true"&gt;
+ *   &lt;processor class="package.Class1" /&gt;
+ *   &lt;processor class="package.Class2" &gt;
+ *     &lt;str name="someInitParam1"&gt;value&lt;/str&gt;
+ *     &lt;int name="someInitParam2"&gt;42&lt;/int&gt;
+ *   &lt;/processor&gt;
  *   &lt;processor class="solr.LogUpdateProcessorFactory" &gt;
  *     &lt;int name="maxNumToLog"&gt;100&lt;/int&gt;
  *   &lt;/processor&gt;
  *   &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
- * &lt;/updateRequestProcessors&gt;
+ * &lt;/updateRequestProcessorChain&gt;
  * </pre>
  * <p>
+ * Multiple Chains can be defined, each with a distinct name.  The name of 
+ * a chain used to handle an update request may be specified using the request 
+ * param <code>update.chain</code>.  If no chain is explicitly selected 
+ * by name, then Solr will attempt to determine a default chain:
+ * </p>
+ * <ul>
+ *  <li>A single configured chain may explicitly be declared with 
+ *      <code>default="true"</code> (see example above)</li>
+ *  <li>If no chain is explicitly declared as the default, Solr will look for
+ *      any chain that does not have a name, and treat it as the default</li>
+ *  <li>As a last resort, Solr will create an implicit default chain 
+ *      consisting of:<ul>
+ *        <li>{@link LogUpdateProcessorFactory}</li>
+ *        <li>{@link DistributedUpdateProcessorFactory}</li>
+ *        <li>{@link RunUpdateProcessorFactory}</li>
+ *      </ul></li>
+ * </ul>
+ *
+ * <p>
  * Allmost all processor chains should end with an instance of 
- * {@link RunUpdateProcessorFactory} unless the user is explicitly 
+ * <code>RunUpdateProcessorFactory</code> unless the user is explicitly 
  * executing the update commands in an alternative custom 
- * <code>UpdateRequestProcessorFactory</code>.
+ * <code>UpdateRequestProcessorFactory</code>.  If a chain includes 
+ * <code>RunUpdateProcessorFactory</code> but does not include a 
+ * <code>DistributingUpdateProcessorFactory</code>, it will be added 
+ * automaticly by {@link #init init()}.
  * </p>
  *
  * @see UpdateRequestProcessorFactory

Modified: lucene/dev/branches/security/solr/core/src/test-files/log4j.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/log4j.properties?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/log4j.properties (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/log4j.properties Wed Jul  3 23:26:32 2013
@@ -7,3 +7,4 @@ log4j.appender.CONSOLE.layout=org.apache
 log4j.appender.CONSOLE.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n
 
 log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.hadoop=WARN

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml Wed Jul  3 23:26:32 2013
@@ -394,6 +394,7 @@
       termVectors="true" termPositions="true" termOffsets="true"/>
    <field name="signatureField" type="string" indexed="true" stored="false"/>
    
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
 
    
    <!-- Dynamic field definitions.  If a field name is not found, dynamicFields

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-folding.xml Wed Jul  3 23:26:32 2013
@@ -221,8 +221,6 @@
     <fieldType name="float" class="solr.TrieFloatField" precisionStep="4" omitNorms="true" positionIncrementGap="0"/>
     <fieldType name="long" class="solr.TrieLongField" precisionStep="4" omitNorms="true" positionIncrementGap="0"/>
     <fieldType name="double" class="solr.TrieDoubleField" precisionStep="4" omitNorms="true" positionIncrementGap="0"/>
-    <fieldType name="byte" class="solr.ByteField" omitNorms="true" positionIncrementGap="0"/>
-    <fieldType name="short" class="solr.ShortField" omitNorms="true" positionIncrementGap="0"/>
     <fieldtype name="boolean" class="solr.BoolField" sortMissingLast="true"/>
     <fieldtype name="date" class="solr.TrieDateField" precisionStep="0"/>
   </types>
@@ -233,8 +231,6 @@
     <field name="float_f" type="float"/>
     <field name="long_f" type="long"/>
     <field name="double_f" type="double"/>
-    <field name="byte_f" type="byte"/>
-    <field name="short_f" type="short"/>
     <field name="bool_f" type="boolean"/>
     <field name="date_f" type="date"/>
 

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-luceneMatchVersion.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-luceneMatchVersion.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-luceneMatchVersion.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-luceneMatchVersion.xml Wed Jul  3 23:26:32 2013
@@ -17,6 +17,7 @@
 -->
 <schema name="luceneMatchVersionTest" version="1.1">
  <types>
+  <fieldtype name="long" class="solr.TrieLongField"/>
   <fieldtype name="string" class="solr.StrField"/>
   <fieldtype name="text40" class="solr.TextField">
     <analyzer>
@@ -50,6 +51,7 @@
    <field name="textDefault" type="textDefault" indexed="true" stored="false" />
    <field name="textStandardAnalyzer40" type="textStandardAnalyzer40" indexed="true" stored="false" />
    <field name="textStandardAnalyzerDefault" type="textStandardAnalyzerDefault" indexed="true" stored="false" />
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
    <dynamicField name="*_sS" type="string"  indexed="false" stored="true"/>
  </fields>
  <uniqueKey>id</uniqueKey>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml Wed Jul  3 23:26:32 2013
@@ -376,7 +376,7 @@
    <field name="intDefault" type="sint" indexed="true" stored="true" default="42" multiValued="false"/>
    <field name="signatureField" type="string" indexed="true" stored="false"/>
    
-
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
    
    <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
         will be used if the name matches any of the patterns.

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml Wed Jul  3 23:26:32 2013
@@ -25,6 +25,7 @@
   <types>
 
 
+    <fieldtype name="long" class="solr.TrieLongField" />
     <fieldtype name="integer" class="solr.IntField" />
     <fieldtype name="string" class="solr.StrField" />
 
@@ -73,6 +74,8 @@
    <field name="two" type="rev" indexed="true" stored="false"/>
    <field name="three" type="text" indexed="true" stored="false"/>
 
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
+
    <field name="signatureField" type="string" indexed="true" stored="false"/>
    <dynamicField name="*_sS" type="string"  indexed="false" stored="true"/>
 

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml Wed Jul  3 23:26:32 2013
@@ -282,6 +282,8 @@
 
    <field name="tdate" type="tdate" indexed="true" stored="true" />
 
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
+
    <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
         will be used if the name matches any of the patterns.
         RESTRICTION: the glob-like pattern in the name attribute must have

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema.xml Wed Jul  3 23:26:32 2013
@@ -48,8 +48,6 @@
     <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
     <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
     <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
-    <fieldType name="byte" class="solr.ByteField" omitNorms="true" positionIncrementGap="0"/>
-    <fieldType name="short" class="solr.ShortField" omitNorms="true" positionIncrementGap="0"/>
 
 
     <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
@@ -609,10 +607,6 @@
    <dynamicField name="*_dt" type="date"    indexed="true"  stored="true"/>
    <dynamicField name="*_dt1" type="date"    indexed="true"  stored="true" multiValued="false"/>
    <dynamicField name="*_bcd" type="bcdstr" indexed="true"  stored="true"/>
-   <dynamicField name="*_by"  type="byte"  indexed="true" stored="true"/>
-   <dynamicField name="*_by1" type="byte"  indexed="true" stored="true" multiValued="false"/>
-   <dynamicField name="*_sh" type="short"  indexed="true" stored="true"/>
-   <dynamicField name="*_sh1" type="short"  indexed="true" stored="true" multiValued="false"/>
 
 
       <!-- some trie-coded dynamic fields for faster range queries -->

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema11.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema11.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema11.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schema11.xml Wed Jul  3 23:26:32 2013
@@ -322,6 +322,8 @@ valued. -->
 
    <field name="text_no_analyzer" type="text_no_analyzer" indexed="true" />
 
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
+
    <!-- Dynamic field definitions.  If a field name is not found, dynamicFields
         will be used if the name matches any of the patterns.
         RESTRICTION: the glob-like pattern in the name attribute must have

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/schemasurround.xml Wed Jul  3 23:26:32 2013
@@ -539,6 +539,8 @@
    <field name="uniq3" type="string" indexed="true" stored="true"/>
    <field name="nouniq" type="string" indexed="true" stored="true" multiValued="true"/>
 
+   <field name="_version_" type="long" indexed="true" stored="true" multiValued="false" />
+
    <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false"/>
 
 

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-SOLR-749.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-SOLR-749.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-SOLR-749.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-SOLR-749.xml Wed Jul  3 23:26:32 2013
@@ -19,6 +19,7 @@
 
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <queryParser name="foo" class="FooQParserPlugin"/>
   <!-- override the default "lucene" qparser -->

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-altdirectory.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-altdirectory.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-altdirectory.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-altdirectory.xml Wed Jul  3 23:26:32 2013
@@ -19,6 +19,7 @@
 
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
   <directoryFactory name="DirectoryFactory" class="org.apache.solr.core.AlternateDirectoryTest$TestFSDirectoryFactory"></directoryFactory>
   <indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.AlternateDirectoryTest$TestIndexReaderFactory"></indexReaderFactory >

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-basic.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-basic.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-basic.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-basic.xml Wed Jul  3 23:26:32 2013
@@ -22,6 +22,7 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
   <dataDir>${solr.data.dir:}</dataDir>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
 </config>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-caching.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-caching.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-caching.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-caching.xml Wed Jul  3 23:26:32 2013
@@ -16,6 +16,7 @@
   -->
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <query>
     <cache name="lfuCacheDecayFalse"
@@ -35,4 +36,4 @@
            size="10"
            initialSize="9" />
   </query>
-</config>
\ No newline at end of file
+</config>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-components-name.xml Wed Jul  3 23:26:32 2013
@@ -17,21 +17,12 @@
  limitations under the License.
 -->
 
-<!-- This is a "kitchen sink" config file that tests can use.
-     When writting a new test, feel free to add *new* items (plugins,
-     config options, etc...) as long as they don't break any existing
-     tests.  if you need to test something esoteric please add a new
-     "solrconfig-your-esoteric-purpose.xml" config file.
-
-     Note in particular that this test is used by MinimalSchemaTest so
-     Anything added to this file needs to work correctly even if there
-     is now uniqueKey or defaultSearch Field.
-  -->
-
 <config>
 
   <jmx />
 
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <!-- Used to specify an alternate directory to hold all index data.
        It defaults to "index" if not present, and should probably
        not be changed if replication is in use. -->

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml Wed Jul  3 23:26:32 2013
@@ -17,7 +17,6 @@
  limitations under the License.
 -->
 
-
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
@@ -26,6 +25,7 @@
   <requestHandler name="standard" class="solr.StandardRequestHandler"/>
 
   <indexConfig>
+   <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
    <deletionPolicy class="solr.SolrDeletionPolicy">
     <str name="keepOptimizedOnly">true</str>
     <str name="maxCommitsToKeep">3</str>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml Wed Jul  3 23:26:32 2013
@@ -21,6 +21,7 @@
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <deletionPolicy class="org.apache.solr.core.FakeDeletionPolicy">
       <str name="var1">value1</str>
 		  <str name="var2">value2</str>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml Wed Jul  3 23:26:32 2013
@@ -32,6 +32,7 @@
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
 
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <lockType>single</lockType>
   </indexConfig>
   
@@ -66,10 +67,8 @@
     </listener>
     -->
 
-
   </updateHandler>
 
-
   <query>
     <!-- Maximum number of clauses in a boolean query... can affect
         range or wildcard queries that expand to big boolean
@@ -77,7 +76,6 @@
     -->
     <maxBooleanClauses>1024</maxBooleanClauses>
 
-
     <!-- Cache specification for Filters or DocSets - unordered set of *all* documents
          that match a particular query.
       -->
@@ -108,19 +106,16 @@
     <!-- set maxSize artificially low to exercise both types of sets -->
     <HashDocSet maxSize="3" loadFactor="0.75"/>
 
-
     <!-- boolToFilterOptimizer converts boolean clauses with zero boost
          into cached filters if the number of docs selected by the clause exceeds
          the threshold (represented as a fraction of the total index)
     -->
     <boolTofilterOptimizer enabled="false" cacheSize="32" threshold=".05"/>
 
-
   </query>
 
   <requestHandler name="/update" class="solr.UpdateRequestHandler"  />
 
-
   <!-- test elevation -->
   <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent" >
     <str name="queryFieldType">string</str>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-enableplugin.xml Wed Jul  3 23:26:32 2013
@@ -28,6 +28,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">
@@ -45,7 +46,6 @@
   <requestHandler name="disabled" class="solr.StandardRequestHandler" enable="false"/>
   <requestHandler name="enabled" class="solr.StandardRequestHandler" enable="true"/>
 
-
   <!-- test query parameter defaults -->
   <requestHandler name="lazy" class="solr.StandardRequestHandler" startup="lazy">
   </requestHandler>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-functionquery.xml Wed Jul  3 23:26:32 2013
@@ -20,6 +20,8 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
  
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <!--  The DirectoryFactory to use for indexes.
         solr.StandardDirectoryFactory, the default, is filesystem based.
         solr.RAMDirectoryFactory is memory based and not persistent. -->
@@ -38,5 +40,4 @@
     <float name="nvlFloatValue">0.0</float>
   </valueSourceParser>
 
-
 </config>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-highlight.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-highlight.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-highlight.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-highlight.xml Wed Jul  3 23:26:32 2013
@@ -20,6 +20,8 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <!--  The DirectoryFactory to use for indexes.
         solr.StandardDirectoryFactory, the default, is filesystem based.
         solr.RAMDirectoryFactory is memory based and not persistent. -->

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml Wed Jul  3 23:26:32 2013
@@ -22,6 +22,8 @@
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <maxIndexingThreads>123</maxIndexingThreads>
+    <infoStream>true</infoStream>
   </indexConfig>
 </config>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-lazywriter.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-lazywriter.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-lazywriter.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-lazywriter.xml Wed Jul  3 23:26:32 2013
@@ -21,6 +21,7 @@
      DO NOT ADD THINGS TO THIS CONFIG! -->
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-managed-schema.xml Wed Jul  3 23:26:32 2013
@@ -20,6 +20,8 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <schemaFactory class="ManagedIndexSchemaFactory">
     <bool name="mutable">false</bool>
     <str name="managedSchemaResourceName">managed-schema</str>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master.xml Wed Jul  3 23:26:32 2013
@@ -24,6 +24,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1-keepOneBackup.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1-keepOneBackup.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1-keepOneBackup.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1-keepOneBackup.xml Wed Jul  3 23:26:32 2013
@@ -23,6 +23,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master1.xml Wed Jul  3 23:26:32 2013
@@ -24,6 +24,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master2.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master2.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master2.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master2.xml Wed Jul  3 23:26:32 2013
@@ -24,6 +24,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master3.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master3.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master3.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-master3.xml Wed Jul  3 23:26:32 2013
@@ -24,6 +24,7 @@
 
   <indexConfig>
     <lockType>single</lockType>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
   </indexConfig>
 
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicy.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicy.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicy.xml Wed Jul  3 23:26:32 2013
@@ -26,7 +26,15 @@
     <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
       <int name="maxMergeAtOnceExplicit">19</int>
       <int name="segmentsPerTier">9</int>
-      <double name="noCFSRatio">1.0</double>
+      <double name="noCFSRatio">0.1</double>
+
+      <!-- Setter for this was moved from the MergePolicies to IndexWriterConfig
+           in Lucene 4.4, so we should treat it the same as a <useCompoundFile>
+           setting and log a warning (instead of failing because the setter is 
+           gone).
+      -->
+      <bool name="useCompoundFile">${useCompoundFile:false}</bool>
+
     </mergePolicy>
   </indexConfig>
 

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-minimal.xml Wed Jul  3 23:26:32 2013
@@ -28,8 +28,7 @@
   <directoryFactory name="DirectoryFactory"
                     class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
 
-  <indexConfig>
-  </indexConfig>
+  <xi:include href="./solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
   <jmx/>
   <updateHandler class="solr.DirectUpdateHandler2">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-mutable-managed-schema.xml Wed Jul  3 23:26:32 2013
@@ -19,6 +19,8 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
   <schemaFactory class="ManagedIndexSchemaFactory">
     <bool name="mutable">true</bool>
     <str name="managedSchemaResourceName">managed-schema</str>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nativelock.xml Wed Jul  3 23:26:32 2013
@@ -28,6 +28,7 @@
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <lockType>native</lockType>
   </indexConfig>
 </config>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-nocache.xml Wed Jul  3 23:26:32 2013
@@ -20,6 +20,7 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <!--  The DirectoryFactory to use for indexes.
         solr.StandardDirectoryFactory, the default, is filesystem based.
         solr.RAMDirectoryFactory is memory based and not persistent. -->

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-phrasesuggest.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-phrasesuggest.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-phrasesuggest.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-phrasesuggest.xml Wed Jul  3 23:26:32 2013
@@ -20,6 +20,7 @@
 <!-- solrconfig.xml for a WFST phrase suggester -->
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <dataDir>${solr.data.dir:}</dataDir>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-postingshighlight.xml Wed Jul  3 23:26:32 2013
@@ -21,6 +21,7 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
   <dataDir>${solr.data.dir:}</dataDir>
+  <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
   <requestHandler name="standard" class="solr.StandardRequestHandler">
     <lst name="defaults">

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject-indexdefault.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject-indexdefault.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject-indexdefault.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject-indexdefault.xml Wed Jul  3 23:26:32 2013
@@ -17,21 +17,6 @@
  limitations under the License.
 -->
 
-<!-- 
-
-     This is a "kitchen sink" config file that tests can use.
-     When writting a new test, feel free to add *new* items (plugins,
-     config options, etc...) as long as they don't break any existing
-     tests.  if you need to test something esoteric please add a new
-     "solrconfig-your-esoteric-purpose.xml" config file.
-
-     Note in particular that this test is used by MinimalSchemaTest so
-     Anything added to this file needs to work correctly even if there
-     is now uniqueKey or defaultSearch Field.
-
-
-  -->
-
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
@@ -41,6 +26,7 @@
   <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
 
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy">
       <double name="maxMergeMB">32.0</double>
     </mergePolicy>

Modified: lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject.xml (original)
+++ lucene/dev/branches/security/solr/core/src/test-files/solr/collection1/conf/solrconfig-propinject.xml Wed Jul  3 23:26:32 2013
@@ -17,22 +17,6 @@
  limitations under the License.
 -->
 
-<!-- 
-
-
-     This is a "kitchen sink" config file that tests can use.
-     When writting a new test, feel free to add *new* items (plugins,
-     config options, etc...) as long as they don't break any existing
-     tests.  if you need to test something esoteric please add a new
-     "solrconfig-your-esoteric-purpose.xml" config file.
-
-     Note in particular that this test is used by MinimalSchemaTest so 
-     Anything added to this file needs to work correctly even if there
-     is now uniqueKey or defaultSearch Field.
-
-
-  -->
-
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
 
@@ -43,6 +27,7 @@
 
  
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy">
       <double name="maxMergeMB">64.0</double>
     </mergePolicy>