lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r805675 - /lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java
Date Wed, 19 Aug 2009 06:29:26 GMT
Author: noble
Date: Wed Aug 19 06:29:26 2009
New Revision: 805675

URL: http://svn.apache.org/viewvc?rev=805675&view=rev
Log:
SOLR-1315 backup command should work when there was no commit/optimize since startup

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java?rev=805675&r1=805674&r2=805675&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/ReplicationHandler.java Wed Aug 19
06:29:26 2009
@@ -131,7 +131,7 @@
     } else if (command.equals(CMD_GET_FILE_LIST)) {
       getFileList(solrParams, rsp);
     } else if (command.equalsIgnoreCase(CMD_BACKUP)) {
-      doSnapShoot(new ModifiableSolrParams(solrParams), rsp);
+      doSnapShoot(new ModifiableSolrParams(solrParams), rsp,req);
       rsp.add(STATUS, OK_STATUS);
     } else if (command.equalsIgnoreCase(CMD_FETCH_INDEX)) {
       String masterUrl = solrParams.get(MASTER_URL);
@@ -268,9 +268,12 @@
     return snapPullLock.isLocked();
   }
 
-  private void doSnapShoot(SolrParams params, SolrQueryResponse rsp) {
+  private void doSnapShoot(SolrParams params, SolrQueryResponse rsp, SolrQueryRequest req)
{
     try {
       IndexCommit indexCommit = core.getDeletionPolicy().getLatestCommit();
+      if(indexCommit == null) {
+        indexCommit = req.getSearcher().getReader().getIndexCommit();
+      }
       if (indexCommit != null)  {
         new SnapShooter(core, params.get("location")).createSnapAsync(indexCommit.getFileNames(),
this);
       }



Mime
View raw message