activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: better deal with journal corruption for scheduler store to report error location - intermittent failure of KahaDBSchedulerIndexRebuildTest
Date Wed, 27 May 2015 11:34:36 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 17bcf4304 -> 0a21c5f8f


better deal with journal corruption for scheduler store  to report error location - intermittent
failure of KahaDBSchedulerIndexRebuildTest


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/0a21c5f8
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/0a21c5f8
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/0a21c5f8

Branch: refs/heads/master
Commit: 0a21c5f8ff8963bf9e17809e8aa2ff8b3f8e5701
Parents: 17bcf43
Author: gtully <gary.tully@gmail.com>
Authored: Wed May 27 12:25:46 2015 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Wed May 27 12:26:06 2015 +0100

----------------------------------------------------------------------
 .../activemq/store/kahadb/MessageDatabase.java  |  2 +-
 .../kahadb/scheduler/JobSchedulerStoreImpl.java | 20 +++++++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/0a21c5f8/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
index 22c967b..e86bed0 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
@@ -614,7 +614,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
                             // track this dud location
                             journal.corruptRecoveryLocation(recoveryPosition);
                         } else {
-                            throw failedRecovery;
+                            throw new IOException("Failed to recover data at position:" +
recoveryPosition, failedRecovery);
                         }
                     }
                     recoveryPosition = journal.getNextLocation(recoveryPosition);

http://git-wip-us.apache.org/repos/asf/activemq/blob/0a21c5f8/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
index 1a08931..7653718 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
@@ -753,12 +753,22 @@ public class JobSchedulerStoreImpl extends AbstractKahaDBStore implements
JobSch
 
             if (recoveryPosition != null) {
                 int redoCounter = 0;
-                LOG.info("Recovering from the journal ...");
+                LOG.info("Recovering from the scheduled job journal @" + recoveryPosition);
                 while (recoveryPosition != null) {
-                    JournalCommand<?> message = load(recoveryPosition);
-                    metaData.setLastUpdateLocation(recoveryPosition);
-                    doRecover(message, recoveryPosition, lastIndoubtPosition);
-                    redoCounter++;
+                    try {
+                        JournalCommand<?> message = load(recoveryPosition);
+                        metaData.setLastUpdateLocation(recoveryPosition);
+                        doRecover(message, recoveryPosition, lastIndoubtPosition);
+                        redoCounter++;
+                    } catch (IOException failedRecovery) {
+                        if (isIgnoreMissingJournalfiles()) {
+                            LOG.debug("Failed to recover data at position:" + recoveryPosition,
failedRecovery);
+                            // track this dud location
+                            journal.corruptRecoveryLocation(recoveryPosition);
+                        } else {
+                            throw new IOException("Failed to recover data at position:" +
recoveryPosition, failedRecovery);
+                        }
+                    }
                     recoveryPosition = journal.getNextLocation(recoveryPosition);
                      if (LOG.isInfoEnabled() && redoCounter % 100000 == 0) {
                          LOG.info("@ {}, {} entries recovered ..", recoveryPosition, redoCounter);


Mime
View raw message