Open fly2F opened 1 year ago
I traced the code and found that the wrong data structure was returned when delete.
diff --git a/pkg/server/etcd/backendshim.go b/pkg/server/etcd/backendshim.go
index 1b56007..00525f8 100644
--- a/pkg/server/etcd/backendshim.go
+++ b/pkg/server/etcd/backendshim.go
@@ -145,10 +145,11 @@ func (b *backendShim) Delete(ctx context.Context, key []byte, revision int64) (*
Succeeded: response.Succeeded,
Responses: []*etcdserverpb.ResponseOp{
{
- Response: &etcdserverpb.ResponseOp_ResponseRange{
- ResponseRange: &etcdserverpb.RangeResponse{
- Header: txnHeader(int64(response.Header.Revision)),
- Kvs: kvs,
+ Response: &etcdserverpb.ResponseOp_ResponseDeleteRange{
+ ResponseDeleteRange: &etcdserverpb.DeleteRangeResponse{
+ Header: txnHeader(int64(response.Header.Revision)),
+ PrevKvs: kvs,
+ Deleted: int64(len(kvs)),
},
},
},
(END)
Is this an experimental project? Has it been used in an internal production environment?
@fly2F sorry for the late response. which version of k8s do you used?
@fly2F i find the problem. https://github.com/kubernetes/kubernetes/pull/113369 fix the related issue which make k8s depend on this field. I think current response can match the requirement of k8s <=1.25. it will be great if you have time to fix it ~ or i will try to fix the problem when i am free.
@divanodestiny Thank you very much for your reply. I used v1.24.0 code for testing and the deletion function is normal.
Is this an experimental project? Has it been used in an internal production environment?
cc @divanodestiny it would be great if we have some ansower.
Is this an experimental project? Has it been used in an internal production environment?
cc @divanodestiny it would be great if we have some ansower.
we use it in our product env. the largest k8s has 20k+ nodes.
What happened?
Commands:
Error:
What did you expect to happen?
Delete resources without error
How can we reproduce it (as minimally and precisely as possible)?
STEP1: build kube-brain
make badger
, start kube-brain./bin/kube-brain --compatible-with-etcd
STEP2: start kube-apiserverSTEP3: delete rsource
Software version