puts that would succeed on consul & zookeeper fail on etcd
@abronan is already working on this.
Since Aug 18, 2015.
Assessment
This issue has not been assessed yet.
Description
Since etcd enforces a distinction between "directory" keys and "file" keys, some sequences of puts that would succeed on the other backends will fail on etcd.
Put("/path/to/", "Hello")
Put("/path/to/new/node", "World!")
will succeed on Consul, but the second call will fail on etcd, since /path/to is a file.
Likewise
Put("/path/to/new/node", "Hello")
Put("/path", "World!")
will fail on etcd since /path is a directory.
I've discussed the next-gen API for etcd with some of their maintainers, and I think they're planning to remove the directory/file distinction for v3. So, this issue may sort itself out on that new API.
I'm not sure there is a satisfactory resolution that doesn't involve a trade off.
One thing that could be done is to automatically change directories to files and vice versa, but this would result in data loss, and so is probably not acceptable.
Another possibility would be for libkv to append a file node suffix to every key when using etcd. E.g.
/path/to/ -> /path/to/__data__
/path/to/new/node -> /path/to/new/node/__data__
This leads to etcd backend behaving the same way as Consul & Zookeeper, however, it makes it very difficult to allow interoperation with other clients of the data store that are not libkv-based, since the keys they see are different.
We could also just do nothing, and warn developers that writing interoperable code requires that they plan their key use carefully so they always write to a leaf node in the tree.
- Dominant language
- Go
- Stars
- 848
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker/libkv
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
JuliusBrussee/caveman#1189 ·
Maintainers usually reply within 1 day
-
agent-review-finding chore
Difficulty 2/5 Half a day Newbie friendliness 78/100
jordansmall/spindrift#4497 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug from-studio
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
esengine/DeepSeek-Reasonix#12044 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100