Zookeeper AtomicPut doesn't respect store.WriteOptions parameter

Open
#108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go

Research direction

Locate the Zookeeper implementation of AtomicPut, Put, and createFullPath, then compare how WriteOptions.TTL is handled in each path. Confirm the expected ephemeral-node behavior for a positive TTL and add or update tests showing that AtomicPut respects the option.

Written by the indexing model from the issue text.

Description

In My case, I set TTL in writeOption and expect zookeeper to create ephemeral node.
AtomicPut doesn't use this parameter at all, and seems set ephemeral = false as default.
if err = s.createFullPath(parts, false); err != nil {
...

However, it seems the Put API create ephemeral node if TTL
if opts != nil && opts.TTL > 0 {
s.createFullPath(store.SplitKey(strings.TrimSuffix(key, "/")), true)
} else {
s.createFullPath(store.SplitKey(strings.TrimSuffix(key, "/")), false)
}

Is this a bug in AtomicPut?

Dominant language
Go
Stars
847
Forks
204
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/libkv

All issues in docker/libkv

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.