Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Compatibility issue--Create index repeatedly,return error:‘ CreateIndexRequest RPC failed! io.grpc.StatusRuntimeException: CANCELLED: Failed to read message.’ #721

Closed
yongpengli-z opened this issue Dec 22, 2023 · 2 comments
Assignees

Comments

@yongpengli-z
Copy link
Collaborator

java-sdk version: v2.2.15
milvus-server: v2.3-latest or master-latest

STEPS:

@Test
public void repeatCreateIndex(){
    String collection = CommonFunction.createNewCollection();
    // 1. create index params
    CreateIndexParam createIndexParams = CreateIndexParam.newBuilder()
            .withCollectionName(collection)
            .withFieldName(CommonData.defaultVectorField)
            .withMetricType(MetricType.L2)
            .withIndexType(IndexType.HNSW)
            .withExtraParam(CommonFunction.provideExtraParam(IndexType.HNSW))
            .withSyncMode(Boolean.TRUE)
            .withSyncWaitingTimeout(30L)
            .withSyncWaitingInterval(500L)
            .build();
    // 2. create index
    R<RpcStatus> rpcStatusR = milvusClient.createIndex(createIndexParams);
    System.out.println("Create index" + rpcStatusR);
    Assert.assertEquals(rpcStatusR.getStatus().intValue(), 0);
    Assert.assertEquals(rpcStatusR.getData().getMsg(), "Success");
    // 3. load collection
    R<RpcStatus> rpcStatusR2 = milvusClient.loadCollection(
            LoadCollectionParam.newBuilder()
                    .withCollectionName(collection)
                    .withSyncLoad(Boolean.TRUE)
                    .build());
    System.out.println("Load collection " + rpcStatusR);
    Assert.assertEquals(rpcStatusR2.getStatus().intValue(), 0);
    Assert.assertEquals(rpcStatusR2.getData().getMsg(), "Success");
    // repeat createIndex
    CreateIndexParam createIndexParams2 = CreateIndexParam.newBuilder()
            .withCollectionName(collection)
            .withFieldName(CommonData.defaultVectorField)
            .withMetricType(MetricType.L2)
            .withIndexType(IndexType.IVF_FLAT)
            .withExtraParam(CommonFunction.provideExtraParam(IndexType.IVF_FLAT))
            .withSyncMode(Boolean.TRUE)
            .withSyncWaitingTimeout(30L)
            .withSyncWaitingInterval(500L)
            .build();
    R<RpcStatus> rpcStatusR3 = milvusClient.createIndex(createIndexParams2);
    System.out.println("Create index" + rpcStatusR2);
    Assert.assertEquals(rpcStatusR3.getStatus().intValue(), 0);
    Assert.assertEquals(rpcStatusR3.getData().getMsg(), "Success");
}

Current result

09:10:59.170 [main] [ERROR] io.milvus.client.AbstractMilvusGrpcClient:3072 --- CreateIndexRequest RPC failed! Collection name:Collection_fTZ5bNfshA, Field name:book_intro
io.grpc.StatusRuntimeException: CANCELLED: Failed to read message.

use milvus server :v2.2.16,Return correctly:

09:29:48.014 [main] [ERROR] io.milvus.client.AbstractMilvusGrpcClient:3072 --- CreateIndexRequest failed:CreateIndex failed: at most one distinct index is allowed per field
Create indexR{exception=Exception: CreateIndex failed: at most one distinct index is allowed per field, status=1, data=null}
@yongpengli-z
Copy link
Collaborator Author

protobuf dependency conflict

@xiaofan-luan
Copy link
Contributor

protobuf dependency conflict

How to solve the conflict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants