apache / apache/curator

[CURATOR-499] ZKPaths strips trailing "/" incorrectly when creating sequential nodes

Open
#1,019 9 comments 0 reactions 0 assignees View on GitHub
bug imported-jira-issue
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I think this was introduced in CURATOR-166, which changed ZKPaths to strip trailing slashes from child nodes.

This is fine in most cases: it made it so 



curatorFramework.create()

    .forPath("/path/to/node/", data);


would create a node at /path/to/node.

However, if you want to create a sequential node:



curatorFramework.create()

    .withMode(CreateMode.PERSISTENT_SEQUENTIAL)
    .forPath("/path/to/node/", data);

In clients after CURATOR-166 (2.7.1 and higher), this will create a node /path/to/node00000001. Before, and if you call the zookeeper cli with the same options, it would create a node /path/to/node/00000001.

This effectively makes it so you cannot use curator to create sequential nodes where the entire node name is the sequence number.

---
Originally reported by mwang5, imported from: ZKPaths strips trailing "/" incorrectly when creating sequential nodes


  • assignee: randgalt
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2025-01-21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.