activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1440435 - /activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
Date Wed, 30 Jan 2013 14:43:25 GMT
Author: chirino
Date: Wed Jan 30 14:43:25 2013
New Revision: 1440435

URL: http://svn.apache.org/viewvc?rev=1440435&view=rev
Log:
Do an index repair if the index file fails to initially open.

Modified:
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala?rev=1440435&r1=1440434&r2=1440435&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
Wed Jan 30 14:43:25 2013
@@ -351,7 +351,14 @@ class LevelDBClient(store: LevelDBStore)
           }
       }
 
-      index = new RichDB(factory.open(dirty_index_file, index_options));
+      try {
+        index = new RichDB(factory.open(dirty_index_file, index_options))
+      } catch {
+        case e:DBException =>
+          // lets try to recover by repairing the index file.
+          factory.repair(dirty_index_file, index_options)
+          index = new RichDB(factory.open(dirty_index_file, index_options))
+      }
 
       try {
         load_log_refs



Mime
View raw message