milvus-io/milvus-sdk-java

loadCollection and releaseCollection ,Can resource isolation be ensured when calling multiple threads simultaneously

lironghai opened this issue · 2 comments

Can resource isolation be ensured when calling multiple threads simultaneously?

for example:
A thread:
singletonMilvusClient.loadCollection("aaa");
singletonMilvusClient.search("aaa",...);
B thread:
singletonMilvusClient.loadCollection("aaa");

A thread:
singletonMilvusClient.releaseCollection ("aaa");

B thread:
singletonMilvusClient.search("aaa",...);

yhmo commented

A thread:
singletonMilvusClient.loadCollection("aaa");
singletonMilvusClient.search("aaa",...);
B thread:
singletonMilvusClient.loadCollection("aaa");

loadCollection() interface is idempotent on the server side, it is no problem to call it from multiple clients.
In Java sdk, all the RPC interfaces are thread-safe, no problem to call the same interface from multiple threads.

yhmo commented

A thread:
singletonMilvusClient.releaseCollection ("aaa");

B thread:
singletonMilvusClient.search("aaa",...);

search will fail if the collection is not fully loaded.
If you call search()/releaseCollection() in different threads at the same time, the search could fail or succeed, both are expected.