Commit daab8e16 authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1946. Server logging should reflect dynamically reconfigured address...

ZOOKEEPER-1946. Server logging should reflect dynamically reconfigured address (Niko Vuokko via phunt and Alexander Shraer)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1607525 13f79535-47bb-0310-9956-ffa450edef68
parent 5a5fae96
......@@ -953,6 +953,9 @@ IMPROVEMENTS:
ZOOKEEPER-1918. Add 64 bit Windows as a supported development
platform (Michi Mutsuzaki via phunt)
ZOOKEEPER-1946. Server logging should reflect dynamically
reconfigured address (Niko Vuokko via phunt and Alexander Shraer)
headers
Release 3.4.0 -
......
......@@ -854,8 +854,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
@Override
public void run() {
setName("QuorumPeer" + "[myid=" + getId() + "]" +
cnxnFactory.getLocalAddress());
updateThreadName();
LOG.debug("Starting quorum peer");
try {
......@@ -1566,6 +1565,7 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
if (myNewQS != null && myNewQS.clientAddr != null
&& !myNewQS.clientAddr.equals(oldClientAddr)) {
cnxnFactory.reconfigure(myNewQS.clientAddr);
updateThreadName();
}
boolean roleChange = updateLearnerType(qv);
......@@ -1685,4 +1685,8 @@ public class QuorumPeer extends ZooKeeperThread implements QuorumStats.Provider
}
}
private void updateThreadName() {
setName("QuorumPeer" + "[myid=" + getId() + "]" +
cnxnFactory.getLocalAddress());
}
}
......@@ -626,6 +626,8 @@ public class ReconfigTest extends ZKTestCase implements DataCallback{
.getPort() == port2);
Assert.assertTrue(qu.getPeer(observerIndex).peer.getClientPort() == port3);
Assert.assertTrue(qu.getPeer(observerIndex).peer.getPeerState() == ServerState.OBSERVING);
Assert.assertTrue(qu.getPeer(observerIndex).peer.getName()
.endsWith(String.format(":%d", port3)));
joiningServers.clear();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment