[ https://issues.apache.org/jira/browse/KAFKA-404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14147362#comment-14147362 ]
Neha Narkhede commented on KAFKA-404: ------------------------------------- Thanks for the latest patch. I think there is a bug in that the check for sepIndex happens on the part of the zk connection string that does not have the path starting from /. So the creation logic is unreachable. How about simplifying it to be- {noformat} if (chroot.length > 1) { val zkConnForChrootCreation = config.zkConnect.substring(0, config.zkConnect.indexOf("/")) val zkClientForChrootCreation = new ZkClient(zkConnForChrootCreation, config.zkSessionTimeoutMs, config.zkConnectionTimeoutMs, ZKStringSerializer) ZkUtils.makeSurePersistentPathExists(zkClientForChrootCreation, chroot) info("Created zookeeper path " + chroot) zkClientForChrootCreation.close() } {noformat} > When using chroot path, create chroot on startup if it doesn't exist > -------------------------------------------------------------------- > > Key: KAFKA-404 > URL: https://issues.apache.org/jira/browse/KAFKA-404 > Project: Kafka > Issue Type: Improvement > Affects Versions: 0.8.1 > Environment: CentOS 5.5, Linux 2.6.18-194.32.1.el5 x86_64 GNU/Linux > Reporter: Jonathan Creasy > Labels: newbie, patch > Fix For: 0.8.2 > > Attachments: KAFKA-404-0.7.1.patch, KAFKA-404-0.8.patch, > KAFKA-404-auto-create-zookeeper-chroot-on-start-up-i.patch, > KAFKA-404-auto-create-zookeeper-chroot-on-start-up-v2.patch, > KAFKA-404-auto-create-zookeeper-chroot-on-start-up-v3.patch, > KAFKA-404-auto-create-zookeeper-chroot-on-start-up-v4.patch > > -- This message was sent by Atlassian JIRA (v6.3.4#6332)