Closed wangyanphp closed 1 year ago
Ordering by key isn't guaranteed anywhere as far as I know. We consider it an implementation detail that we have not chosen to replicate. Kubernetes doesn't require it.
Ordering by key isn't guaranteed anywhere as far as I know. We consider it an implementation detail that we have not chosen to replicate. Kubernetes doesn't require it.
ok, I didn't realize that k8s relies on the order of keys until I saw it using keys for paging list: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go#L800
in k8s paging list implement, the next list request using last key+'\x00' as key
Ordering by key isn't guaranteed anywhere as far as I know. We consider it an implementation detail that we have not chosen to replicate. Kubernetes doesn't require it.
ok, I didn't realize that k8s relies on the order of keys until I saw it using keys for paging list: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go#L800
in k8s paging list implement, the next list request using last key+'\x00' as key
I had a misunderstanding about the code implementation, but I've corrected my understanding by debugging the code step by step, thank you very much
when i send a list request to kine, i get results which are order by id.![image](https://github.com/k3s-io/kine/assets/13374363/2bcf53c8-fdf7-4ac9-ad87-c822bdf7160e)
but when i send a list request to etcd, i will get results which are order by name.
so my question is: The behavior of kine and etcd isn't the same, is this an expected behavior?