Marcosrico commented on code in PR #2377:
URL: https://github.com/apache/helix/pull/2377#discussion_r1107315244
##########
meta-client/src/test/java/org/apache/helix/metaclient/impl/zk/TestZkMetaClient.java:
##########
@@ -67,8 +68,16 @@ public class TestZkMetaClient {
private ZkServer _zkServer;
+ /**
+ * Creates local Zk Server
+ * Note: Cannot test container / TTL node end to end behavior as
+ * the zk server setup doesn't allow for that. However, the actual
+ * behavior has been verified to work on native ZK Client.
Review Comment:
To enable proper end-to-end behavior between TTL and Container nodes in unit
testing, it is necessary to invoke ContainerManager.java when setting up the Zk
server. ContainerManager object is responsible for managing the creation /
deletion of znodes (lifecycle of the nodes).
Since nodes with TTL and Container modes are designed to be deleted after a
certain interval, a zk server with a ContainerManager is required for running
these nodes. This can be achieved by using classes such as
LeaderZooKeeperServer.java or ZooKeeperServerMain.java. However, the current
implementation of zk server in metaclient and helix test base utilizes a
simplified zk server setup (ZooKeeperServer), which lacks a ContainerManager
implementation.
It is necessary to create both a ContainerManager and
`System.setProperty("zookeeper.extendedTypesEnabled", "true");` in order for
TTL and Container nodes to function properly.
For future work, the setup of the zk server needs to be changed to use the
appropriate classes mentioned above to enable the proper functioning of TTL and
Container nodes in unit testing. I'll update the comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]