summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-05-22 00:43:45 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-05-22 00:43:45 +0000
commitb151c0ee395681f8f402491b575e373b55be059e (patch)
tree0b28492f59f8356f2dccd19c8fa43818ac7dc6ef /src/main
parentd4735520c811c81c2874e2d97d6d7204bf0f5ae7 (diff)
Fix automatic replication repair which might sometimes throw IllegalStateException.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
index 3ab69c0..bdacca4 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
@@ -294,18 +294,16 @@ class ReplicationTrigger<S extends Storable> extends Trigger<S> {
}
}
} else {
- try {
- if (!master.tryLoad()) {
- // Both are missing -- no repair needed.
- return;
- }
- } catch (IllegalStateException e) {
- // Can be caused by not fully defining the primary key on
- // the replica, but an alternate key is. The insert will
- // fail anyhow, so don't try to repair.
+ if (!master.tryLoad()) {
+ // Both are missing -- no repair needed.
return;
}
}
+ } catch (IllegalStateException e) {
+ // Can be caused by not fully defining the primary key on the
+ // replica, but an alternate key is. The insert will fail anyhow,
+ // so don't try to repair.
+ return;
} catch (FetchException e) {
throw e.toPersistException();
}