summaryrefslogtreecommitdiff
path: root/qpid/java/bdbstore/src/main
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2015-03-25 10:57:13 +0000
committerAlex Rudyy <orudyy@apache.org>2015-03-25 10:57:13 +0000
commit2cbf48987d84b9e553cd840742e6aa377d444094 (patch)
treebc07c4d83cb463884b0ce3372a2cd15bbca20b73 /qpid/java/bdbstore/src/main
parent9639e5681551135f0a92c7cfb063127b7d29231f (diff)
downloadqpid-python-2cbf48987d84b9e553cd840742e6aa377d444094.tar.gz
QPID-6464: Set replica consistency policy to 'NoConsistencyPolicy' in order to avoid hanging for timeout specified in TimeConsistencyPolicy on creation of JE transaction after transition from Master into Detached state when HA claster has no majority but the remaining Master change configuration tasks attempted to execute
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1669092 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/bdbstore/src/main')
-rw-r--r--qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
index b88e99c805..e16ed737af 100644
--- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
+++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
@@ -165,7 +165,14 @@ public class ReplicatedEnvironmentFacade implements EnvironmentFacade, StateChan
*/
put(ReplicationConfig.LOG_FLUSH_TASK_INTERVAL, "1 min");
- put(ReplicationConfig.CONSISTENCY_POLICY, "TimeConsistencyPolicy(1 s,30 s)");
+ /**
+ * Allow Replica to proceed with transactions regardless of the state of a Replica
+ * At the moment we do not read or write databases on Replicas.
+ * Setting consistency policy to NoConsistencyRequiredPolicy
+ * would allow to create transaction on Replica immediately.
+ * Any followed write operation would fail with ReplicaWriteException.
+ */
+ put(ReplicationConfig.CONSISTENCY_POLICY, NoConsistencyRequiredPolicy.NAME);
}});
public static final String PERMITTED_NODE_LIST = "permittedNodes";
@@ -402,6 +409,14 @@ public class ReplicatedEnvironmentFacade implements EnvironmentFacade, StateChan
return new ConnectionScopedRuntimeException(String.format("Environment '%s' cannot finish JE operation because master is unknown", getNodeName()), dbe);
}
+ if (dbe instanceof ReplicaWriteException || dbe instanceof ReplicaConsistencyException)
+ {
+ // Master transited into Detached/Replica but underlying Configured Object has not been notified yet
+ // and attempted to perform JE operation.
+ // We need to abort any ongoing JE operation without halting the Broker or VHN/VH
+ return new ConnectionScopedRuntimeException(String.format("Environment '%s' cannot finish JE operation because node is not master", getNodeName()), dbe);
+ }
+
boolean restart = (noMajority || dbe instanceof RestartRequiredException);
if (restart)
{