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]: [null & default] Failed to create collection for the second time with the same schema when set "default_value" property for one field #36457

Closed
1 task done
binbinlv opened this issue Sep 24, 2024 · 5 comments
Assignees
Labels
kind/bug Issues or changes related a bug priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Sep 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20240920-6e430bd4
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.5.0rc80
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Failed to create collection for the second time with the same schema when set "default_value" property for one field

results:

pymilvus.exceptions.SchemaNotReadyException: <SchemaNotReadyException: (code=1, message=The collection already exist, but the schema is not the same as the schema passed in.)>

Expected Behavior

the collection is returned successfully for the existing collection with the same schema

Steps To Reproduce

Run the following script for twice

from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
import json
import random
import numpy as np

connections.connect()

dim = 768
int64_field = FieldSchema(name="int64", dtype=DataType.INT64, is_primary=True)
double_field = FieldSchema(name="nullableFid", dtype=DataType.VARCHAR, max_length=100)
int32_field = FieldSchema(name="int32", dtype=DataType.FLOAT, default_value=np.float32(10.0))
float_vector = FieldSchema(name="float_vector", dtype=DataType.FLOAT_VECTOR, dim=dim)
schema = CollectionSchema(fields=[int64_field, double_field, int32_field, float_vector])
collection = Collection("test", schema=schema)

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Sep 24, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Sep 24, 2024
@binbinlv
Copy link
Contributor Author

it breaks the atomicity for create collection operation, so set it as urgent.

@binbinlv binbinlv added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 24, 2024
@binbinlv
Copy link
Contributor Author

The field with "nullalbe=True" is OK for this scenario.

sre-ci-robot pushed a commit to milvus-io/pymilvus that referenced this issue Oct 8, 2024
@smellthemoon
Copy link
Contributor

pr merged, could you please check it? @binbinlv

@smellthemoon
Copy link
Contributor

/assign @binbinlv

@binbinlv
Copy link
Contributor Author

Verified and fixed:

pymilvus:2.5.0rc88
milvus: master-20241011-3fe0f829-amd64

results:

>>> from pymilvus import Collection
>>> from pymilvus import connections
>>> from pymilvus import DataType
>>> from pymilvus import Partition
>>> from pymilvus import utility
from pymilvus import CollectionSchema, FieldSchema
>>> import json
from pymilvus import CollectionSchema, FieldSchema
>>> import random
>>> import numpy as np
>>>
>>>
>>> connections.connect()
>>> dim = 768
>>> int64_field = FieldSchema(name="int64", dtype=DataType.INT64, is_primary=True)
>>> double_field = FieldSchema(name="nullableFid", dtype=DataType.VARCHAR, max_length=100)
>>> int32_field = FieldSchema(name="int32", dtype=DataType.FLOAT, default_value=np.float32(10.0))
>>> float_vector = FieldSchema(name="float_vector", dtype=DataType.FLOAT_VECTOR, dim=dim)
>>> schema = CollectionSchema(fields=[int64_field, double_field, int32_field, float_vector])
>>>
>>> collection = Collection("test", schema=schema)
from pymilvus import CollectionSchema, FieldSchema
>>>
>>> collection = Collection("test", schema=schema)
>>>
>>>
>>> collection = Collection("test", schema=schema)
>>>
>>>
>>> collection = Collection("test", schema=schema)
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

2 participants