kubewharf / kubebrain

A High Performance Metadata System for Kubernetes
Apache License 2.0
771 stars 77 forks source link

The "watch" not triggered when the watch key not start with "/" #37

Open nengc opened 6 months ago

nengc commented 6 months ago

What happened?

When i set the watch key as "/etcd-test", and put value to the key "/etcd-test", the watch worked. But when i remove the "/", the watch will not triggered.

image

What did you expect to happen?

With ETCD server, watching without prefix "/" key will work. But not work when using kubebrain.

How can we reproduce it (as minimally and precisely as possible)?

Using etcd client v3

Software version

```console $ version # paste output here ```
divanodestiny commented 6 months ago

@nengc kubebrain is not fully compatible with etcd3. we assert that apiserver will not watch without prefix "/".

we hacks that when etcd client send watch request without prefix "/", kubebrain process it as streaming list request. it is used to return a KV list through grpc stream to apiserver instead of paged list request for better performance and less cost.