Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.8.3, 3.9.1
-
None
-
None
Description
The test case EphemeralNodeDeletionTest describes that a follower loses its connection with leader when the client writes an ephemeral node, and it should delete the node after the client closed. However, the case fails when I make all followers lose connections.
To reproduce the bug, I simply modified testEphemeralNodeDeletion() as following:
// 2: inject network problem in two followers ArrayList<CustomQuorumPeer> followers = getFollowers(); for (CustomQuorumPeer follower : followers) { follower.setInjectError(true); } //CustomQuorumPeer follower = (CustomQuorumPeer) getByServerState(mt, ServerState.FOLLOWING); //follower.setInjectError(true); // 3: close the session so that ephemeral node is deleted zk.close(); // remove the error //follower.setInjectError(false); for (CustomQuorumPeer follower : followers) { follower.setInjectError(false); assertTrue(ClientBase.waitForServerUp("127.0.0.1:" + follower.getClientPort(), CONNECTION_TIMEOUT), "Faulted Follower should have joined quorum by now"); }
And here is added method getFollowers():
private ArrayList<CustomQuorumPeer> getFollowers() { ArrayList<CustomQuorumPeer> followers = new ArrayList<>(); for (int i = 0; i <= mt.length - 1; i++) { QuorumPeer quorumPeer = mt[i].getQuorumPeer(); if (null != quorumPeer && ServerState.FOLLOWING == quorumPeer.getPeerState()) { followers.add((CustomQuorumPeer)quorumPeer); } } return followers; }