milvus icon indicating copy to clipboard operation
milvus copied to clipboard

[Bug]: Duplicated indexes are created on a field and cannot be dropped

Open yhmo opened this issue 11 months ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Environment

- Milvus version: v2.5.4
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

From this discussion: https://github.com/milvus-io/milvus/discussions/42031

Deploy a milvus v2.5.4 Run this scrtipt to reproduce:

import threading

from pymilvus import (
    MilvusClient, DataType,
)


def create_collection(collection_name):
    client = MilvusClient(uri="http://localhost:19530")
    print(client.get_server_version())

    schema = MilvusClient.create_schema()
    schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True, auto_id=False)
    schema.add_field(field_name="embedding", datatype=DataType.FLOAT_VECTOR, dim=768)

    index_params = client.prepare_index_params()
    index_params.add_index(
        field_name="embedding",
        index_name="embedding",
        index_type="AUTOINDEX",
        metric_type="IP",
    )
    client.create_collection(
        collection_name=collection_name,
        schema=schema,
        index_params=index_params
    )
    print(collection_name, "created")

    client.create_index(collection_name=collection_name, index_params=index_params)
    print("index01 created")


threads = []
for i in range(10):
    collection_name = "CCC"
    thread = threading.Thread(target=create_collection, args=(collection_name,))
    threads.append(thread)
    thread.start()

for thread in threads:
    thread.join()


client = MilvusClient(uri="http://localhost:19530")
client.release_collection(collection_name="CCC")
client.drop_index(collection_name="CCC", index_name="embedding")

You will get this error: [ERROR][handler]: RPC error: [drop_index], <MilvusException: (code=702, message=index duplicates[indexName=embedding])>,

Upgrade the milvus to v2.5.11, try to drop the index, still get the "index duplicates" error.

client = MilvusClient(uri="http://localhost:19530")
client.release_collection(collection_name="CCC")
client.drop_index(collection_name="CCC", index_name="embedding")

Expected Behavior

The v2.5.4 can create duplicated indexes on a field, but this illegal index cannot be dropped even if we upgrade to a higher version. I think the higher version should be able to drop the duplicated indexes. Otherwise, the collection is cracked.

Steps To Reproduce


Milvus Log

No response

Anything else?

No response

yhmo avatar May 23 '25 10:05 yhmo

/assign @congqixia can we do this in birdwatcher?

/unassign

yanliang567 avatar May 24 '25 10:05 yanliang567

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.

stale[bot] avatar Oct 25 '25 04:10 stale[bot]