Buggy code:
@ SuppressWarnings ( "unchecked" ) public void inform ( SolrCore core ) { this . core = core ; registerFileStreamResponseWriter ( ) ; registerCloseHook ( ) ; Object nbtk = initArgs . get ( ReplicationHandler . NUMBER_BACKUPS_TO_KEEP_INIT_PARAM ) ; if ( nbtk != null ) { numberBackupsToKeep = Integer . parseInt ( nbtk . toString ( ) ) ; } else { numberBackupsToKeep = 0 ; } NamedList slave = ( ( NamedList ) ( initArgs . get ( "slave" ) ) ) ; boolean enableSlave = isEnabled ( slave ) ; if ( enableSlave ) { tempSnapPuller = snapPuller = new SnapPuller ( slave , this , core ) ; isSlave = true ; } NamedList master = ( ( NamedList ) ( initArgs . get ( "master" ) ) ) ; boolean enableMaster = isEnabled ( master ) ; if ( ( ! enableSlave ) && ( ! enableMaster ) ) { enableMaster = true ; master = new NamedList < Object > ( ) ; } if ( enableMaster ) { includeConfFiles = ( ( String ) ( master . get ( ReplicationHandler . CONF_FILES ) ) ) ; if ( ( ( includeConfFiles ) != null ) && ( ( includeConfFiles . trim ( ) . length ( ) ) > 0 ) ) { List < String > files = Arrays . asList ( includeConfFiles . split ( "," ) ) ; for ( String file : files ) { if ( ( file . trim ( ) . length ( ) ) == 0 ) continue ; String [ ] strs = file . trim ( ) . split ( ":" ) ; confFileNameAlias . add ( strs [ 0 ] , ( ( strs . length ) > 1 ? strs [ 1 ] : null ) ) ; } ReplicationHandler . LOG . info ( ( "Replication<seq2seq4repair_space>enabled<seq2seq4repair_space>for<seq2seq4repair_space>following<seq2seq4repair_space>config<seq2seq4repair_space>files:<seq2seq4repair_space>" + ( includeConfFiles ) ) ) ; } List backup = master . getAll ( "backupAfter" ) ; boolean backupOnCommit = backup . contains ( "commit" ) ; boolean backupOnOptimize = ( ! backupOnCommit ) && ( backup . contains ( "optimize" ) ) ; List replicateAfter = master . getAll ( ReplicationHandler . REPLICATE_AFTER ) ; replicateOnCommit = replicateAfter . contains ( "commit" ) ; replicateOnOptimize = ( ! ( replicateOnCommit ) ) && ( replicateAfter . contains ( "optimize" ) ) ; if ( ( ! ( replicateOnCommit ) ) && ( ! ( replicateOnOptimize ) ) ) { replicateOnCommit = true ; } if ( replicateOnOptimize ) { IndexDeletionPolicyWrapper wrapper = core . getDeletionPolicy ( ) ; IndexDeletionPolicy policy = ( wrapper == null ) ? null : wrapper . getWrappedDeletionPolicy ( ) ; if ( policy instanceof SolrDeletionPolicy ) { SolrDeletionPolicy solrPolicy = ( ( SolrDeletionPolicy ) ( policy ) ) ; if ( ( solrPolicy . getMaxOptimizedCommitsToKeep ( ) ) < 1 ) { solrPolicy . setMaxOptimizedCommitsToKeep ( 1 ) ; } } else { ReplicationHandler . LOG . warn ( ( "Replication<seq2seq4repair_space>can't<seq2seq4repair_space>call<seq2seq4repair_space>setMaxOptimizedCommitsToKeep<seq2seq4repair_space>on<seq2seq4repair_space>" + policy ) ) ; } } if ( ( replicateOnOptimize ) || backupOnOptimize ) { core . getUpdateHandler ( ) . registerOptimizeCallback ( getEventListener ( backupOnOptimize , replicateOnOptimize ) ) ; } if ( ( replicateOnCommit ) || backupOnCommit ) { replicateOnCommit = true ; core . getUpdateHandler ( ) . registerCommitCallback ( getEventListener ( backupOnCommit , replicateOnCommit ) ) ; } if ( replicateAfter . contains ( "startup" ) ) { replicateOnStart = true ; RefCounted < SolrIndexSearcher > s = core . getNewestSearcher ( false ) ; try { DirectoryReader reader = ( s == null ) ? null : s . get ( ) . getIndexReader ( ) ; if ( ( ( reader != null ) && ( ( reader . getIndexCommit ( ) ) != null ) ) && ( ( reader . getIndexCommit ( ) . getGeneration ( ) ) != 1L ) ) { try { if ( replicateOnOptimize ) { Collection < IndexCommit > commits = DirectoryReader . listCommits ( reader . directory ( ) ) ; for ( IndexCommit ic : commits ) { if ( ( ic . getSegmentCount ( ) ) == 1 ) { if ( ( ( indexCommitPoint ) == null ) || ( ( indexCommitPoint . getGeneration ( ) ) < ( ic . getGeneration ( ) ) ) ) indexCommitPoint = ic ; } } } else { indexCommitPoint = reader . getIndexCommit ( ) ; } } finally { } } <START_BUG> core . getUpdateHandler ( ) . newIndexWriter ( ) ; <END_BUG> } catch ( IOException e ) { ReplicationHandler . LOG . warn ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>IndexCommit<seq2seq4repair_space>on<seq2seq4repair_space>startup" , e ) ; } finally { if ( s != null ) s . decref ( ) ; } } String reserve = ( ( String ) ( master . get ( ReplicationHandler . RESERVE ) ) ) ; if ( ( reserve != null ) && ( ! ( reserve . trim ( ) . equals ( "" ) ) ) ) { reserveCommitDuration = SnapPuller . readInterval ( reserve ) ; } ReplicationHandler . LOG . info ( ( "Commits<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>reserved<seq2seq4repair_space>for<seq2seq4repair_space>" + ( reserveCommitDuration ) ) ) ; isMaster = true ; } } private boolean isEnabled ( NamedList params ) { } private void registerCloseHook ( ) { } private void registerFileStreamResponseWriter ( ) { } private SolrEventListener getEventListener ( final boolean snapshoot , final boolean getCommit ) { } private class FileStream { private SolrParams params ; private FastOutputStream fos ; private Long indexGen ; private IndexDeletionPolicyWrapper delPolicy ; public FileStream ( SolrParams solrParams ) { } public void write ( OutputStream out ) throws IOException { } private void writeNothing ( ) throws IOException { } } public static final String MASTER_URL = "masterUrl" ; public static final String STATUS = "status" ; public static final String COMMAND = "command" ; public static final String CMD_DETAILS = "details" ; public static final String CMD_BACKUP = "backup" ;

Fix:
core . getUpdateHandler ( ) . newIndexWriter ( true ) ;