mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 19:39:21 +08:00
enhance: improve the lock key of the create/drop collection task (#37759)
/kind improvement Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
8216345b07
commit
3bbbf3cd95
@ -157,7 +157,7 @@ Currently, the objects injected by expr include: <code>param</code>, <code>proxy
|
||||
if (xhr.status === 200) {
|
||||
document.getElementById('resultText').textContent = JSON.stringify(JSON.parse(xhr.responseText), null, 2);
|
||||
} else {
|
||||
document.getElementById('resultText').textContent = 'Error: ' + xhr.status;
|
||||
document.getElementById('resultText').textContent = `Error: ${xhr.status}, detail: ${xhr.responseText}`;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
@ -664,6 +664,7 @@ func (t *createCollectionTask) Execute(ctx context.Context) error {
|
||||
func (t *createCollectionTask) GetLockerKey() LockerKey {
|
||||
return NewLockerKeyChain(
|
||||
NewClusterLockerKey(false),
|
||||
NewDatabaseLockerKey(t.Req.GetDbName(), true),
|
||||
NewDatabaseLockerKey(t.Req.GetDbName(), false),
|
||||
NewCollectionLockerKey(t.Req.GetCollectionName(), true),
|
||||
)
|
||||
}
|
||||
|
@ -121,5 +121,9 @@ func (t *dropCollectionTask) Execute(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (t *dropCollectionTask) GetLockerKey() LockerKey {
|
||||
return NewLockerKeyChain(NewClusterLockerKey(false), NewDatabaseLockerKey(t.Req.GetDbName(), true))
|
||||
return NewLockerKeyChain(
|
||||
NewClusterLockerKey(false),
|
||||
NewDatabaseLockerKey(t.Req.GetDbName(), false),
|
||||
NewCollectionLockerKey(t.Req.GetCollectionName(), true),
|
||||
)
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ func TestGetLockerKey(t *testing.T) {
|
||||
},
|
||||
}
|
||||
key := tt.GetLockerKey()
|
||||
assert.Equal(t, GetLockerKeyString(key), "$-0-false|foo-1-true")
|
||||
assert.Equal(t, GetLockerKeyString(key), "$-0-false|foo-1-false|bar-2-true")
|
||||
})
|
||||
t.Run("create database task locker key", func(t *testing.T) {
|
||||
tt := &createDatabaseTask{
|
||||
@ -233,7 +233,7 @@ func TestGetLockerKey(t *testing.T) {
|
||||
},
|
||||
}
|
||||
key := tt.GetLockerKey()
|
||||
assert.Equal(t, GetLockerKeyString(key), "$-0-false|foo-1-true")
|
||||
assert.Equal(t, GetLockerKeyString(key), "$-0-false|foo-1-false|bar-2-true")
|
||||
})
|
||||
t.Run("drop database task locker key", func(t *testing.T) {
|
||||
tt := &dropDatabaseTask{
|
||||
|
Loading…
Reference in New Issue
Block a user