fix: Fix binlog import (#31205)

1. File type validation is omitted during binlog import.
2. System fields are appended to the schema during binlog import.

issue: https://github.com/milvus-io/milvus/issues/28521

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/31179/head
yihao.dai 2024-03-13 10:35:04 +08:00 committed by GitHub
parent 1d96239137
commit 87b3c25b15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -5631,11 +5631,15 @@ func (node *Proxy) ImportV2(ctx context.Context, req *internalpb.ImportRequest)
resp.Status = merr.Status(merr.WrapErrParameterInvalidMsg("import request is empty"))
return resp, nil
}
for _, file := range req.GetFiles() {
_, err = importutilv2.GetFileType(file)
if err != nil {
resp.Status = merr.Status(err)
return resp, nil
isBackup := importutilv2.IsBackup(req.GetOptions())
if !isBackup {
// check file type
for _, file := range req.GetFiles() {
_, err = importutilv2.GetFileType(file)
if err != nil {
resp.Status = merr.Status(err)
return resp, nil
}
}
}
importRequest := &internalpb.ImportRequestInternal{

View File

@ -48,6 +48,7 @@ func NewReader(ctx context.Context,
tsStart,
tsEnd uint64,
) (*reader, error) {
schema = typeutil.AppendSystemFields(schema)
r := &reader{
ctx: ctx,
cm: cm,