[ https://issues.apache.org/jira/browse/SOLR-6214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14069801#comment-14069801 ]
Ramana edited comment on SOLR-6214 at 7/22/14 4:36 AM: ------------------------------------------------------- Attached is the patch. Basically, "numberToKeep" is to indicate how many backups to retain (including this one). Reference http://wiki.apache.org/solr/SolrReplication Now, we are not considering the new snapshot directory while comparing "numberToKeep" parameter with existing directories size. if(numberToKeep > dirs.size()-1) { return; } with the changes in the patch, always "numbertokeep" parameter will be satisfied. Please verify. was (Author: ramanaopensource): Attached is the patch. Basically, "numberToKeep" is to indicate how many backups to retain (including this one). Reference http://wiki.apache.org/solr/SolrReplication Now, we are not considering the new snapshot directory while comparing "numberToKeep" parameter with existing directories size. if(numberToKeep > dirs.size()-1) { return; } Please verify. > Snapshots numberToKeep param only keeps n-1 backups > --------------------------------------------------- > > Key: SOLR-6214 > URL: https://issues.apache.org/jira/browse/SOLR-6214 > Project: Solr > Issue Type: Bug > Affects Versions: 4.9 > Reporter: Mathias H. > Priority: Minor > Attachments: SOLR-6214.patch > > > The numberToKeep param for snapshots doesn't work anymore. If you set the > param to '2', only '1' backup is kept. > In the ReplicationHandler in line 377 snapShooter.validateCreateSnapshot(); > creates an empty directory for the new snapshot. The deleteOldBackups() > method in Snapshooter which will be executed before the backup is created, > now sees the two directories an deletes the old one. But this is wrong > because the empty directory for the new backup should not be considered. -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org