title: Why does my solr slave index keep growing?
body: <p>I have a 5-core solr 1.4 master that is replicated to another 5-core solr using solr replication as described <a href="http://wiki.apache.org/solr/SolrReplication" rel="nofollow noreferrer">here</a>. All writes are done against the master and replicated to the slave intermittently. This is done using the following sequence:</p>
  
  <ol>
  <li>Commit on each master core</li>
  <li>Replicate on each slave core</li>
  <li>Optimize on each slave core</li>
  <li>Commit on each slave core</li>
  </ol>
  
  <p>The problem I am having is that the slave seems to be keeping around old index files and taking up ever more disk space. For example, after 3 replications, the master core data directory looks like this:</p>
  
  <pre><code>$ du -sh *
  145M    index
  </code></pre>
  
  <p>But the data directory on the slave of the same core looks like this:</p>
  
  <pre><code>$ du -sh *
  300M    index
  144M    index.20100621042048
  145M    index.20100629035801
  4.0K    index.properties
  4.0K    replication.properties
  </code></pre>
  
  <p>Here's the contents of index.properties:</p>
  
  <pre><code>#index properties
  #Tue Jun 29 15:58:13 CDT 2010
  index=index.20100629035801
  </code></pre>
  
  <p>And replication.properties:</p>
  
  <pre><code>#Replication details
  #Tue Jun 29 15:58:13 CDT 2010
  replicationFailedAtList=1277155032914
  previousCycleTimeInSeconds=12
  timesFailed=1
  indexReplicatedAtList=1277845093709,1277155253911,1277155032914
  indexReplicatedAt=1277845093709
  replicationFailedAt=1277155032914
  lastCycleBytesDownloaded=150616512
  timesIndexReplicated=3
  </code></pre>
  
  <p>The solrconfig.xml for this slave contains the default deletion policy:</p>
  
  <pre><code>[...]
  &lt;mainIndex&gt;
      &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
      &lt;reopenReaders&gt;true&lt;/reopenReaders&gt;
      &lt;deletionPolicy class="solr.SolrDeletionPolicy"&gt;
          &lt;str name="maxCommitsToKeep"&gt;1&lt;/str&gt;
          &lt;str name="maxOptimizedCommitsToKeep"&gt;0&lt;/str&gt;
      &lt;/deletionPolicy&gt;
  &lt;/mainIndex&gt;
  [...]
  </code></pre>
  
  <p>What am I missing?</p>