[CURATOR-282] In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace
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.Testpublic class PlayZK { private TestingServer server private CuratorFramework client
@Before <span class="code-keyword">public</span> void setup() {server = new TestingServer(8788) server.start(); println "ConnectString: " + server.getConnectString() client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(8000)) client.start() }
@Test <span class="code-keyword">public</span> 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 <span class="code-keyword">public</span> 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
[Originally related to: CURATOR-499]