Open yanliang567 opened 1 week ago
another test for this case:
@pytest.mark.tags(CaseLabel.L0)
def test_alias_rename_collection_to_alias_name(self):
"""
target: test renaming a collection to a alias name
method:
1.create a collection
2.create an alias for the collection
3.rename the collection to the alias name
"""
self._connect()
c_name = cf.gen_unique_str("collection")
collection_w = self.init_collection_wrap(name=c_name, schema=default_schema,
check_task=CheckTasks.check_collection_property,
check_items={exp_name: c_name, exp_schema: default_schema})
alias_name = cf.gen_unique_str(prefix)
self.utility_wrap.create_alias(collection_w.name, alias_name)
error = {ct.err_code: 999,
ct.err_msg: f"duplicated new collection name default:{alias_name} with other collection name or alias"}
self.utility_wrap.rename_collection(collection_w.name, alias_name,
check_task=CheckTasks.err_res, check_items=error)
collection_w.drop()
collection_w = self.init_collection_wrap(name=c_name, schema=default_schema,
check_task=CheckTasks.check_collection_property,
check_items={exp_name: c_name, exp_schema: default_schema})
error = {ct.err_code: 999,
ct.err_msg: f"this is not expected, any collection name or alias name shall be unique"}
self.utility_wrap.rename_collection(collection_w.name, alias_name,
check_task=CheckTasks.err_res, check_items=error)
Is there an existing issue for this?
Environment
Current Behavior
via birdwatcher, we can see the alias still exists while the alias linked the collection was dropped.
Expected Behavior
if dropping a collection, drop the collection and the related aliases as well. as a workaround, users have to manually drop the alias name, and recreate a alias with the same alias name.
Steps To Reproduce
Milvus Log
No response
Anything else?
run the test below: