From 390454fba6f8e869a27c8db3cf3f35ffb4bb8793 Mon Sep 17 00:00:00 2001 From: James Dyer Date: Tue, 28 Feb 2012 15:53:13 +0000 Subject: [PATCH] SOLR-3168: "numberToKeep" backups doesn't ever keep more than 1 git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294703 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ solr/core/src/java/org/apache/solr/handler/SnapShooter.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 84e37245775..6508d4b0a81 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -622,6 +622,9 @@ Bug Fixes * SOLR-2909: Add support for ResourceLoaderAware tokenizerFactories in synonym filter factories. (Tom Klonikowski, Jun Ohtani via Koji Sekiguchi) + +* SOLR-3168: ReplicationHandler "numberToKeep" & "maxNumberOfBackups" parameters + would keep only 1 backup, even if more than 1 was specified (Neil Hooey, James Dyer) Other Changes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java index bbfd63fb4a9..e0415a8f9ab 100644 --- a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java +++ b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java @@ -135,7 +135,7 @@ public class SnapShooter { Collections.sort(dirs); int i=1; for(OldBackupDirectory dir : dirs) { - if( i > numberToKeep-1 ) { + if( i++ > numberToKeep-1 ) { SnapPuller.delTree(dir.dir); } }