summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE-NOTES.txt1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java16
2 files changed, 8 insertions, 9 deletions
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 8409c3f..2bddb97 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -57,6 +57,7 @@ Carbonado change history
- Index build skips records which are corrupt instead of giving up entirely.
- Support named databases in one BDB file.
- Add index repair method.
+- Fix automatic replication repair which might sometimes throw IllegalStateException.
1.1 to 1.1.2
-------------------------------
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();
}