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]: [GoSDK] After loading a collection asynchronously, querying it immediately returns a bad msg #37857

Open
1 task done
ThreadDao opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@ThreadDao
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

  1. collection fields: int64, floatVector, enable dynamic field
  2. load collection asynchronously and skip dynamic field
  3. query immediately but gets an error message that is not instructive.
_, err = mc.LoadCollection(ctx, clientv2.NewLoadCollectionOption(schema.CollectionName).WithSkipLoadDynamicField(true))
common.CheckErr(t, err, true)
// err = loadTask.Await(ctx)
// common.CheckErr(t, err, true)

// search and verify output dynamic fields
	_, err = mc.Query(ctx, clientv2.NewQueryOption(schema.CollectionName).WithOutputFields(common.DefaultDynamicNumberField).WithLimit(10))
	common.CheckErr(t, err, false, fmt.Sprintf("field %s cannot be returned since dynamic field not loaded", common.DefaultDynamicNumberField))
[2024/11/20 19:33:29.836 +08:00] [INFO] [base/milvus_client.go:53] [Response] [method=Query] [resp="{\"status\":{\"error_code\":1,\"reason\":\"fail to Query on QueryNode 1: worker(1) query failed: unordered_map::at\",\"code\":65535,\"detail\":\"failed to query: failed to search/query delegator 1 for channel zong-master-op-48-7019-rootcoord-dml_7_454011068505958424v0: fail to Query on QueryNode 1: worker(1) que..."]
[2024/11/20 19:33:29.836 +08:00] [DEBUG] [base/milvus_client.go:54] [Cost] [method=Query] [cost=2.0166671s]
--- FAIL: TestLoadSkipDynamicField (9.16s)
    /home/zong/zong/projects/milvus/tests/go_client/testcases/response_checker.go:28: 
        	Error Trace:	/home/zong/zong/projects/milvus/tests/go_client/common/response_checker.go:28
        	            				/home/zong/zong/projects/milvus/tests/go_client/testcases/load_release_test.go:344
        	Error:      	Error "fail to Query on QueryNode 1: worker(1) query failed: unordered_map::at" does not contain "field dynamicNumber cannot be returned since dynamic field not loaded"
        	Test:       	TestLoadSkipDynamicField

Expected Behavior

No response

Steps To Reproduce

func TestLoadSkipDynamicField(t *testing.T) {
	/*
		1. release and reload with skip load dynamic field=true
		2. search on dynamic field in expr and/or output_fields
	*/
	// create collection -> insert -> flush -> index
	ctx := hp.CreateContext(t, time.Second*common.DefaultTimeout)
	mc := createDefaultMilvusClient(ctx, t)

	// create collection -> insert -> flush -> index -> load
	prepare, schema := hp.CollPrepare.CreateCollection(ctx, t, mc, hp.NewCreateCollectionParams(hp.Int64Vec), hp.TNewFieldsOption(), hp.TNewSchemaOption().TWithEnableDynamicField(true))
	prepare.InsertData(ctx, t, mc, hp.NewInsertParams(schema), hp.TNewDataOption())
	prepare.FlushData(ctx, t, mc, schema.CollectionName)
	prepare.CreateIndex(ctx, t, mc, hp.TNewIndexParams(schema))
	prepare.Load(ctx, t, mc, hp.NewLoadParams(schema.CollectionName))

	// query and verify output dynamic fields
	queryRes, err := mc.Query(ctx, clientv2.NewQueryOption(schema.CollectionName).WithOutputFields(common.DefaultDynamicFieldName).WithLimit(10))
	common.CheckErr(t, err, true)
	common.CheckOutputFields(t, []string{common.DefaultDynamicFieldName, common.DefaultInt64FieldName}, queryRes.Fields)

	// reload and skip dynamic field
	mc.ReleaseCollection(ctx, clientv2.NewReleaseCollectionOption(schema.CollectionName))
	_, err = mc.LoadCollection(ctx, clientv2.NewLoadCollectionOption(schema.CollectionName).WithSkipLoadDynamicField(true))
	common.CheckErr(t, err, true)
	// err = loadTask.Await(ctx)
	// common.CheckErr(t, err, true)

	// search and verify output dynamic fields
	_, err = mc.Query(ctx, clientv2.NewQueryOption(schema.CollectionName).WithOutputFields(common.DefaultDynamicNumberField).WithLimit(10))
	common.CheckErr(t, err, false, fmt.Sprintf("field %s cannot be returned since dynamic field not loaded", common.DefaultDynamicNumberField))

	_, err = mc.Query(ctx, clientv2.NewQueryOption(schema.CollectionName).WithFilter(fmt.Sprintf("%s > 0", common.DefaultDynamicNumberField)))
	common.CheckErr(t, err, false, "but dynamic field is not loaded")
}

Milvus Log

No response

Anything else?

No response

@ThreadDao ThreadDao added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 20, 2024
@ThreadDao ThreadDao added this to the 2.5.0 milestone Nov 20, 2024
@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 20, 2024
@yanliang567 yanliang567 assigned congqixia and unassigned yanliang567 Nov 20, 2024
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 triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants