apache / apache/curator

[CURATOR-282] In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace

Open
#802 1 comment 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

Here is a junit test write in groovy.


import org.apache.curator.framework.CuratorFramework

import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.RetryOneTime
import org.apache.curator.test.TestingServer
import org.apache.zookeeper.CreateMode
import org.junit.After
import org.junit.Before
import org.junit.Test

public class PlayZK {
private TestingServer server
private CuratorFramework client

@Before
public void setup() {
server = new TestingServer(8788)
server.start();
println "ConnectString: " + server.getConnectString()
client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(8000))
client.start()
}

@Test
public void issues() {
println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/test/data/sub");
println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/sub");
println "Create sub " + client.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")
println "Create sub " + client.usingNamespace("test/data").create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")

println "Expected sub"
client.children.forPath("/test/data").each {println it}
println "Expected 0000000000"
client.children.forPath("/test/data/sub").each {println it}
println "Expected 0000000000"
client.children.forPath("/sub").each {println it}
}

@After
public void down() {
server.stop()
}
}



// will create /test/data/sub0000000001

client.usingNamespace("test/data").create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")

// will create /test/data/sub/0000000000
client.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")


Which one is expected ?

---
Originally reported by wener, imported from: In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace


  • assignee: randgalt
  • status: Open
  • priority: Major
  • 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.