diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-02-07 02:22:46 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-02-07 02:22:46 +0000 |
commit | a87a673fe9f0db0ba4f6a5dd4d1e1cecb9283331 (patch) | |
tree | 943d8bf3f81640ccb28ce816bad9883c5aad0004 /src/main/java/com/amazon/carbonado | |
parent | 18fb999087a4ebe38420d28dee478ac2b24e44a9 (diff) |
Don't attempt to repair inconsistency when not fully defining the primary key on the replica.
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java | 15 |
1 files changed, 12 insertions, 3 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 ebce796..249a779 100644 --- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java +++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java @@ -321,9 +321,18 @@ class ReplicationTrigger<S extends Storable> extends Trigger<S> { return;
}
}
- } else if (!master.tryLoad()) {
- // Both are missing -- no repair needed.
- return;
+ } 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.
+ return;
+ }
}
} catch (FetchException e) {
throw e.toPersistException();
|