[
https://issues.apache.org/jira/browse/QPID-5715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13984170#comment-13984170
]
Alex Rudyy edited comment on QPID-5715 at 4/29/14 10:50 AM:
------------------------------------------------------------
Keith,
Here are my comment on commit [r1590917|https://svn.apache.org/r1590917]:
* There is no validation on setting role to a MASTER that desired role is
actually a master. It seems that transfer to master will be executed even if
user will request set role to REPLICA instead of throwing a validation
exception. IMHO, we need to add the validation logic as follows:
{code:java}
@Override
protected void validateChange(final ConfiguredObject<?> proxyForValidation,
final Set<String> changedAttributes)
{
super.validateChange(proxyForValidation, changedAttributes);
if (changedAttributes.contains(ROLE))
{
String currentRole = getRole();
if (!ReplicatedEnvironment.State.REPLICA.name().equals(currentRole))
{
throw new IllegalArgumentException("Cannot transfer mastership
when not a replica");
}
if
(!ReplicatedEnvironment.State.MASTER.name().equals(((BDBHARemoteReplicationNode<?>)proxyForValidation).getRole()))
{
throw new IllegalArgumentException("Changing role to other
value then " + ReplicatedEnvironment.State.MASTER.name() + " is unsupported");
}
}
}
{code}
was (Author: alex.rufous):
Keith,
Here are my comments on commit [r1590917|https://svn.apache.org/r1590917]:
* It looks like that Role should be a derived attribute and annotation
ManagedAttribute should be declared on method getRole rather than field.
* Attributes priority, quorumOverride should be derived too with annotation
ManagedAttribute declared on getters
* There is no validation on setting role to a MASTER that desired role is
actually a master. It seems that transfer to master will be executed even if
user will request set role to REPLICA instead of throwing a validation
exception. IMHO, we need to add the validation logic as follows:
{code:java}
@Override
protected void validateChange(final ConfiguredObject<?> proxyForValidation,
final Set<String> changedAttributes)
{
super.validateChange(proxyForValidation, changedAttributes);
if (changedAttributes.contains(ROLE))
{
String currentRole = getRole();
if (!ReplicatedEnvironment.State.REPLICA.name().equals(currentRole))
{
throw new IllegalArgumentException("Cannot transfer mastership
when not a replica");
}
if
(!ReplicatedEnvironment.State.MASTER.name().equals(((BDBHARemoteReplicationNode<?>)proxyForValidation).getRole()))
{
throw new IllegalArgumentException("Changing role to other
value then " + ReplicatedEnvironment.State.MASTER.name() + " is unsupported");
}
}
}
{code}
> [Java Broker] Introduce VirtualHostNode into model
> --------------------------------------------------
>
> Key: QPID-5715
> URL: https://issues.apache.org/jira/browse/QPID-5715
> Project: Qpid
> Issue Type: Sub-task
> Components: Java Broker
> Reporter: Keith Wall
> Assignee: Keith Wall
>
> In order to support the HA use-case, a new object, VirtualHostNode will be
> added into the Broker model. The Broker will support zero or more virtual
> host nodes. Each virtual host node may have zero or one virtual hosts.
> Virtualhostnode will be responsible for
> * the lifecycle of the durable configuration store
> * the recovery of its children (that is, the virtual host and its object
> descendants (exchanges, queues etc) but not messages/message instances etc).
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]