Github user cammckenzie commented on a diff in the pull request:
https://github.com/apache/curator/pull/281#discussion_r233227009
--- Diff:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
---
@@ -445,7 +445,8 @@ private void createNode()
try
{
String existingPath = nodePath.get();
- String createPath = (existingPath != null && !useProtection) ?
existingPath : basePath;
+ String createPath = existingPath == null || (useProtection &&
!isSequential(mode)) ? basePath
+ : (useProtection ? basePath +
existingPath.substring(existingPath.length()-10) : existingPath);
--- End diff --
Thanks @Randgalt, I figured that there was a good place to put this, but
couldn't remember where it should be. @njhill can you refactor the sequential
number extraction into org.apache.curator.utils.ZKPaths class? Or, if you don't
have time, let me know and I'll get it done.
---