fix etcd list recursive
current implementation only list first layer nodes.
while fixing this bug, encounter some other issues
KVPairinzookeeperdoesn't contain parent name as prefixstorage.putbehave does not consist between backends. for example, creating keys likea/b/c, etcd will automatically createa,bitems so there will be 3 items, whichconsulandzookeeperdoesn't, this lead to the second issue I encountered.testListtest case is broken, the reason state above.
I think we have to fix the consistency of storage.put first before this PR get merged.
Hi @JeffChien, thanks for hacking on libkv.
I think this is intended. recursive here means getting the direct child node values but not one level deeper.
If we want this behavior and truly list everything recursively (which is a super expensive operation), it should be parameterized with a bool recursive on List in my opinion.
Concerning point number 2, see #20, it is expected too because etcd manages directories differently. I think this PR can find its way if we pass recursive as an argument (to make it optional) and wait for the issue on Put to be fixed :)
It will be great if List can have parameters. if libkv not allow recursively list keys, I think there some code should be changed.
- consul's
Listfunction, official go api enablerecurseoption, can't find a trivial way to disable it, maybe through http api? - etcd's
recursiveshould be false
the response of these commands return a recursive list, even we don't handle it.
again, thanks to your reply.