milvus
milvus copied to clipboard
[Bug]: EtcdKV CompareAndSwap interface semantic is confused
Is there an existing issue for this?
- [X] I have searched the existing issues
Environment
- Milvus version:
- Deployment mode(standalone or cluster):
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS):
- CPU/Memory:
- GPU:
- Others:
Current Behavior
etcdKV support compareAndSwap by value and version, if compare failed it will throw NewCompareFailedError.
Expected Behavior
- compareAndSwap should support idempotent retry.
- if version or value mismatch, should return true/false rather than direct return error
Steps To Reproduce
No response
Anything else?
No response
/assign /unassign @xiaofan-luan
Let me take this
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.
/reopen lets keep tracking this
@XuanYang-cn: Reopened this issue.
In response to this:
/reopen lets keep tracking this
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.
keep it open for tracking
leave it there
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.
/reopen
@XuanYang-cn: Reopened this issue.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/unstale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.
unstale
Found no usage of these 4 functions, and the bool part is already done.
func (kv *EtcdKV) CompareValueAndSwap(key, value, target string, opts ...clientv3.OpOption) (bool, error)
func (kv *EtcdKV) CompareValueAndSwapBytes(key string, value, target []byte, opts ...clientv3.OpOption) (bool, error)
func (kv *EtcdKV) CompareVersionAndSwap(key string, source int64, target string, opts ...clientv3.OpOption) (bool, error)
func (kv *EtcdKV) CompareVersionAndSwapBytes(key string, source int64, target []byte, opts ...clientv3.OpOption) (bool, error)
One question, I found these ut
747 success, err = etcdKV.CompareValueAndSwap("a/b/c", "1", "2")
748 assert.True(t, success)
749 assert.NoError(t, err)
750
751 success, err = etcdKV.CompareValueAndSwap("a/b/c", "1", "2")
752 assert.NoError(t, err)
753 assert.False(t, success)
Dose idempotent means if the first write is a success, then if the value to write is equal to the actual value read, do nothing and return success? @xiaofan-luan
747 success, err = etcdKV.CompareValueAndSwap("a/b/c", "1", "2")
748 assert.True(t, success)
749 assert.NoError(t, err)
750
751 success, err = etcdKV.CompareValueAndSwap("a/b/c", "1", "2")
752 assert.NoError(t, err)
753 *assert.True(t, success)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.