Buggy code:
private void createAlias ( Aliases aliases , ZkNodeProps message ) { } private void checkForAlias ( String name , String value ) { } private void checkForAliasAbsence ( String name ) { } private void deleteAlias ( Aliases aliases , ZkNodeProps message ) { } private boolean createShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { } private boolean splitShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) { } private void commit ( NamedList results , String slice , Replica parentShardLeader ) { } static UpdateResponse softCommit ( String url ) throws IOException , SolrServerException { } private String waitForCoreNodeName ( DocCollection collection , String msgBaseUrl , String msgCore ) { } private void collectShardResponses ( NamedList results , boolean abortOnError , String msgOnError ) { } private void deleteShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) { } private void migrate ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { } private void migrateKey ( ClusterState clusterState , DocCollection sourceCollection , Slice sourceSlice , DocCollection targetCollection , Slice targetSlice , String splitKey , int timeout , NamedList results ) throws InterruptedException , KeeperException { } private Range intersect ( DocRouter . Range a , DocRouter . Range b ) { } private void sendShardRequest ( String nodeName , ModifiableSolrParams params ) { } private void addPropertyParams ( ZkNodeProps message , ModifiableSolrParams params ) { } private void createCollection ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { String collectionName = message . getStr ( "name" ) ; if ( clusterState . getCollections ( ) . contains ( collectionName ) ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( "collection<seq2seq4repair_space>already<seq2seq4repair_space>exists:<seq2seq4repair_space>" + collectionName ) ) ; } try { int repFactor = message . getInt ( OverseerCollectionProcessor . REPLICATION_FACTOR , 1 ) ; Integer numSlices = message . getInt ( OverseerCollectionProcessor . NUM_SLICES , null ) ; String router = message . getStr ( "router.name" , DEFAULT_NAME ) ; List < String > shardNames = new ArrayList < String > ( ) ; if ( NAME . equals ( router ) ) { Overseer . getShardNames ( shardNames , message . getStr ( "shards" , null ) ) ; numSlices = shardNames . size ( ) ; } else { Overseer . getShardNames ( numSlices , shardNames ) ; } if ( numSlices == null ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( OverseerCollectionProcessor . NUM_SLICES ) + "<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>required<seq2seq4repair_space>param" ) ) ; } int maxShardsPerNode = message . getInt ( OverseerCollectionProcessor . MAX_SHARDS_PER_NODE , 1 ) ; String createNodeSetStr ; List < String > createNodeList = ( ( createNodeSetStr = message . getStr ( OverseerCollectionProcessor . CREATE_NODE_SET ) ) == null ) ? null : StrUtils . splitSmart ( createNodeSetStr , "," , true ) ; if ( repFactor <= 0 ) { <START_BUG> throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( OverseerCollectionProcessor . REPLICATION_FACTOR ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>or<seq2seq4repair_space>equal<seq2seq4repair_space>to<seq2seq4repair_space>0" ) ) ; <END_BUG> } if ( numSlices <= 0 ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( OverseerCollectionProcessor . NUM_SLICES ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>><seq2seq4repair_space>0" ) ) ; } Set < String > nodes = clusterState . getLiveNodes ( ) ; List < String > nodeList = new ArrayList < String > ( nodes . size ( ) ) ; nodeList . addAll ( nodes ) ; if ( createNodeList != null ) nodeList . retainAll ( createNodeList ) ; Collections . shuffle ( nodeList ) ; if ( ( nodeList . size ( ) ) <= 0 ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>collection<seq2seq4repair_space>" + collectionName ) + ".<seq2seq4repair_space>No<seq2seq4repair_space>live<seq2seq4repair_space>Solr-instances" ) + ( createNodeList != null ? ( ( "<seq2seq4repair_space>among<seq2seq4repair_space>Solr-instances<seq2seq4repair_space>specified<seq2seq4repair_space>in<seq2seq4repair_space>" + ( OverseerCollectionProcessor . CREATE_NODE_SET ) ) + ":" ) + createNodeSetStr : "" ) ) ) ; } if ( repFactor > ( nodeList . size ( ) ) ) { OverseerCollectionProcessor . log . warn ( ( ( ( ( ( ( ( ( ( ( "Specified<seq2seq4repair_space>" + ( OverseerCollectionProcessor . REPLICATION_FACTOR ) ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + repFactor ) + "<seq2seq4repair_space>on<seq2seq4repair_space>collection<seq2seq4repair_space>" ) + collectionName ) + "<seq2seq4repair_space>is<seq2seq4repair_space>higher<seq2seq4repair_space>than<seq2seq4repair_space>or<seq2seq4repair_space>equal<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>Solr<seq2seq4repair_space>instances<seq2seq4repair_space>currently<seq2seq4repair_space>live<seq2seq4repair_space>or<seq2seq4repair_space>part<seq2seq4repair_space>of<seq2seq4repair_space>your<seq2seq4repair_space>" ) + ( OverseerCollectionProcessor . CREATE_NODE_SET ) ) + "(" ) + ( nodeList . size ( ) ) ) + ").<seq2seq4repair_space>Its<seq2seq4repair_space>unusual<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>two<seq2seq4repair_space>replica<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>slice<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>Solr-instance." ) ) ; } int maxShardsAllowedToCreate = maxShardsPerNode * ( nodeList . size ( ) ) ; int requestedShardsToCreate = numSlices * repFactor ; if ( maxShardsAllowedToCreate < requestedShardsToCreate ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>collection<seq2seq4repair_space>" + collectionName ) + ".<seq2seq4repair_space>Value<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( OverseerCollectionProcessor . MAX_SHARDS_PER_NODE ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>" ) + maxShardsPerNode ) + ",<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>live<seq2seq4repair_space>nodes<seq2seq4repair_space>is<seq2seq4repair_space>" ) + ( nodeList . size ( ) ) ) + ".<seq2seq4repair_space>This<seq2seq4repair_space>allows<seq2seq4repair_space>a<seq2seq4repair_space>maximum<seq2seq4repair_space>of<seq2seq4repair_space>" ) + maxShardsAllowedToCreate ) + "<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>created.<seq2seq4repair_space>Value<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( OverseerCollectionProcessor . NUM_SLICES ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>" ) + numSlices ) + "<seq2seq4repair_space>and<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( OverseerCollectionProcessor . REPLICATION_FACTOR ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>" ) + repFactor ) + ".<seq2seq4repair_space>This<seq2seq4repair_space>requires<seq2seq4repair_space>" ) + requestedShardsToCreate ) + "<seq2seq4repair_space>shards<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>created<seq2seq4repair_space>(higher<seq2seq4repair_space>than<seq2seq4repair_space>the<seq2seq4repair_space>allowed<seq2seq4repair_space>number)" ) ) ; } Overseer . getInQueue ( zkStateReader . getZkClient ( ) ) . offer ( ZkStateReader . toJSON ( message ) ) ; long waitUntil = ( System . currentTimeMillis ( ) ) + 30000 ; boolean created = false ; while ( ( System . currentTimeMillis ( ) ) < waitUntil ) { Thread . sleep ( 100 ) ; created = zkStateReader . getClusterState ( ) . getCollections ( ) . contains ( message . getStr ( "name" ) ) ; if ( created ) break ; } if ( ! created ) throw new SolrException ( ErrorCode . SERVER_ERROR , ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>fully<seq2seq4repair_space>createcollection:<seq2seq4repair_space>" + ( message . getStr ( "name" ) ) ) ) ; String configName = message . getStr ( OverseerCollectionProcessor . COLL_CONF ) ; OverseerCollectionProcessor . log . info ( "going<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>cores<seq2seq4repair_space>replicas<seq2seq4repair_space>shardNames<seq2seq4repair_space>{}<seq2seq4repair_space>,<seq2seq4repair_space>repFactor<seq2seq4repair_space>:<seq2seq4repair_space>{}"

Fix:
throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( OverseerCollectionProcessor . REPLICATION_FACTOR ) + "<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>0" ) ) ;