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

fix: add the db information in the dml message #37969

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/proxy/meta_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/milvus-io/milvus/pkg/util"
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
"github.com/milvus-io/milvus/pkg/util/conc"
"github.com/milvus-io/milvus/pkg/util/expr"
"github.com/milvus-io/milvus/pkg/util/funcutil"
"github.com/milvus-io/milvus/pkg/util/merr"
"github.com/milvus-io/milvus/pkg/util/paramtable"
Expand Down Expand Up @@ -350,6 +351,7 @@ func InitMetaCache(ctx context.Context, rootCoord types.RootCoordClient, queryCo
if err != nil {
return err
}
expr.Register("cache", globalMetaCache)

// The privilege info is a little more. And to get this info, the query operation of involving multiple table queries is required.
resp, err := rootCoord.ListPolicy(ctx, &internalpb.ListPolicyRequest{})
Expand Down
1 change: 1 addition & 0 deletions internal/proxy/msg_pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func genInsertMsgsByPartition(ctx context.Context,
),
CollectionID: insertMsg.CollectionID,
PartitionID: partitionID,
DbName: insertMsg.DbName,
CollectionName: insertMsg.CollectionName,
PartitionName: partitionName,
SegmentID: segmentID,
Expand Down
17 changes: 9 additions & 8 deletions internal/proxy/task_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type deleteTask struct {
primaryKeys *schemapb.IDs
collectionID UniqueID
partitionID UniqueID
dbID UniqueID
partitionKeyMode bool

// set by scheduler
Expand Down Expand Up @@ -148,14 +149,11 @@ func (dt *deleteTask) Execute(ctx context.Context) (err error) {

result, numRows, err := repackDeleteMsgByHash(
ctx,
dt.primaryKeys,
dt.vChannels,
dt.idAllocator,
dt.ts,
dt.collectionID,
dt.req.GetCollectionName(),
dt.partitionID,
dt.req.GetPartitionName(),
dt.primaryKeys, dt.vChannels,
dt.idAllocator, dt.ts,
dt.collectionID, dt.req.GetCollectionName(),
dt.partitionID, dt.req.GetPartitionName(),
dt.req.GetDbName(),
)
if err != nil {
return err
Expand Down Expand Up @@ -204,6 +202,7 @@ func repackDeleteMsgByHash(
collectionName string,
partitionID int64,
partitionName string,
dbName string,
) (map[uint32][]*msgstream.DeleteMsg, int64, error) {
maxSize := Params.PulsarCfg.MaxMessageSize.GetAsInt()
hashValues := typeutil.HashPK2Channels(primaryKeys, vChannels)
Expand Down Expand Up @@ -233,6 +232,7 @@ func repackDeleteMsgByHash(
PartitionID: partitionID,
CollectionName: collectionName,
PartitionName: partitionName,
DbName: dbName,
PrimaryKeys: &schemapb.IDs{},
ShardName: vchannel,
},
Expand Down Expand Up @@ -413,6 +413,7 @@ func (dr *deleteRunner) produce(ctx context.Context, primaryKeys *schemapb.IDs)
partitionKeyMode: dr.partitionKeyMode,
vChannels: dr.vChannels,
primaryKeys: primaryKeys,
dbID: dr.dbID,
}
var enqueuedTask task = dt
if streamingutil.IsStreamingServiceEnabled() {
Expand Down
13 changes: 5 additions & 8 deletions internal/proxy/task_delete_streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ func (dt *deleteTaskByStreamingService) Execute(ctx context.Context) (err error)

dt.tr = timerecord.NewTimeRecorder(fmt.Sprintf("proxy execute delete %d", dt.ID()))
result, numRows, err := repackDeleteMsgByHash(
ctx,
dt.primaryKeys,
dt.vChannels,
dt.idAllocator,
dt.ts,
dt.collectionID,
ctx, dt.primaryKeys,
dt.vChannels, dt.idAllocator,
dt.ts, dt.collectionID,
dt.req.GetCollectionName(),
dt.partitionID,
dt.req.GetPartitionName(),
dt.partitionID, dt.req.GetPartitionName(),
dt.req.GetDbName(),
)
if err != nil {
return err
Expand Down
10 changes: 4 additions & 6 deletions internal/proxy/task_upsert_streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@
result, numRows, err := repackDeleteMsgByHash(
ctx,
it.upsertMsg.DeleteMsg.PrimaryKeys,
vChannels,
it.idAllocator,
vChannels, it.idAllocator,

Check warning on line 112 in internal/proxy/task_upsert_streaming.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/task_upsert_streaming.go#L112

Added line #L112 was not covered by tests
it.BeginTs(),
it.upsertMsg.DeleteMsg.CollectionID,
it.upsertMsg.DeleteMsg.CollectionName,
it.upsertMsg.DeleteMsg.PartitionID,
it.upsertMsg.DeleteMsg.PartitionName,
it.upsertMsg.DeleteMsg.CollectionID, it.upsertMsg.DeleteMsg.CollectionName,
it.upsertMsg.DeleteMsg.PartitionID, it.upsertMsg.DeleteMsg.PartitionName,
it.req.GetDbName(),

Check warning on line 116 in internal/proxy/task_upsert_streaming.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/task_upsert_streaming.go#L114-L116

Added lines #L114 - L116 were not covered by tests
)
if err != nil {
return nil, err
Expand Down
Loading