[
https://issues.apache.org/jira/browse/ZOOKEEPER-1997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hongchao Deng updated ZOOKEEPER-1997:
-------------------------------------
Description:
A server goes to standalone mode and there is a single server line in ensemble
description.
{code}
server.1=xxx
{code}
This
[check|https://github.com/apache/zookeeper/blob/4bb76bd22916de8dcfe0c40f649d02d61737e871/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java#L403]
will throw an exception:
{code}
} else if (numParticipators == 1 && standaloneEnabled) {
// HBase currently adds a single server line to the config, for
// b/w compatibility reasons we need to keep this here. If
standaloneEnabled
// is true, the QuorumPeerMain script will create a standalone
server instead
// of a quorum configuration
LOG.error("Invalid configuration, only one server specified
(ignoring)");
if (numObservers > 0) {
throw new IllegalArgumentException("Observers w/o quorum is an
invalid configuration");
}
}
{code}
The test
[testStandaloneQuorum|https://github.com/apache/zookeeper/blob/fa6d21fa8a8acba812237538e4f7172faf969d37/src/java/test/org/apache/zookeeper/test/StandaloneTest.java#L64]
was successful before -- the client port was ignored and the server was
responding through the jetty port.
When I do a client port check, it failed.
I am wondering what should happen in this case. Should it allow such case to
happen?
was:
A server goes to standalone mode and there is a single server line in ensemble
description.
{code}
server.1=xxx
{code}
This
[check|https://github.com/apache/zookeeper/blob/4bb76bd22916de8dcfe0c40f649d02d61737e871/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java#L403]
will throw an exception:
{code}
} else if (numParticipators == 1 && standaloneEnabled) {
// HBase currently adds a single server line to the config, for
// b/w compatibility reasons we need to keep this here. If
standaloneEnabled
// is true, the QuorumPeerMain script will create a standalone
server instead
// of a quorum configuration
LOG.error("Invalid configuration, only one server specified
(ignoring)");
if (numObservers > 0) {
throw new IllegalArgumentException("Observers w/o quorum is an
invalid configuration");
}
}
{code}
The test
[testStandaloneQuorum|https://github.com/apache/zookeeper/blob/fa6d21fa8a8acba812237538e4f7172faf969d37/src/java/test/org/apache/zookeeper/test/StandaloneTest.java#L64]
was incorrectly successful before -- the client port was ignored and the
server was responding through the jetty port.
When I do a client port check, it failed.
> fix testStandaloneQuorum in StandaloneTest
> ------------------------------------------
>
> Key: ZOOKEEPER-1997
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1997
> Project: ZooKeeper
> Issue Type: Bug
> Reporter: Hongchao Deng
>
> A server goes to standalone mode and there is a single server line in
> ensemble description.
> {code}
> server.1=xxx
> {code}
> This
> [check|https://github.com/apache/zookeeper/blob/4bb76bd22916de8dcfe0c40f649d02d61737e871/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java#L403]
> will throw an exception:
> {code}
> } else if (numParticipators == 1 && standaloneEnabled) {
> // HBase currently adds a single server line to the config, for
> // b/w compatibility reasons we need to keep this here. If
> standaloneEnabled
> // is true, the QuorumPeerMain script will create a standalone
> server instead
> // of a quorum configuration
> LOG.error("Invalid configuration, only one server specified
> (ignoring)");
> if (numObservers > 0) {
> throw new IllegalArgumentException("Observers w/o quorum is
> an invalid configuration");
> }
> }
> {code}
> The test
> [testStandaloneQuorum|https://github.com/apache/zookeeper/blob/fa6d21fa8a8acba812237538e4f7172faf969d37/src/java/test/org/apache/zookeeper/test/StandaloneTest.java#L64]
> was successful before -- the client port was ignored and the server was
> responding through the jetty port.
> When I do a client port check, it failed.
> I am wondering what should happen in this case. Should it allow such case to
> happen?
--
This message was sent by Atlassian JIRA
(v6.2#6252)