未验证 提交 3904a782 编写于 作者: X xing.zhao 提交者: GitHub

Remove genReqID function in import manager bacause the request ID is useless (#17853)

Signed-off-by: Nxingzhao <xing.zhao@zilliz.com>
Co-authored-by: Nxingzhao <xing.zhao@zilliz.com>
上级 5a85e6aa
......@@ -485,19 +485,19 @@ message ImportTaskState {
}
message ImportTaskInfo {
int64 id = 1; // Task ID.
int64 request_id = 2; // Request ID of the import task.
int64 datanode_id = 3; // ID of DataNode that processes the task.
int64 collection_id = 4; // Collection ID for the import task.
int64 partition_id = 5; // Partition ID for the import task.
repeated string channel_names = 6; // Names of channels for the collection.
string bucket = 7; // Bucket for the import task.
bool row_based = 8; // Boolean indicating whether import files are row-based or column-based.
repeated string files = 9; // A list of files to import.
int64 create_ts = 10; // Timestamp when the import task is created.
ImportTaskState state = 11; // State of the import task.
bool data_queryable = 12; // A flag indicating whether import data are queryable (i.e. loaded in query nodes)
bool data_indexed = 13; // A flag indicating whether import data are indexed.
int64 id = 1; // Task ID.
int64 request_id = 2 [deprecated = true]; // Request ID of the import task.
int64 datanode_id = 3; // ID of DataNode that processes the task.
int64 collection_id = 4; // Collection ID for the import task.
int64 partition_id = 5; // Partition ID for the import task.
repeated string channel_names = 6; // Names of channels for the collection.
string bucket = 7; // Bucket for the import task.
bool row_based = 8; // Boolean indicating whether import files are row-based or column-based.
repeated string files = 9; // A list of files to import.
int64 create_ts = 10; // Timestamp when the import task is created.
ImportTaskState state = 11; // State of the import task.
bool data_queryable = 12; // A flag indicating whether import data are queryable (i.e. loaded in query nodes)
bool data_indexed = 13; // A flag indicating whether import data are indexed.
}
message ImportTaskResponse {
......
......@@ -222,22 +222,6 @@ func (m *importManager) sendOutTasks(ctx context.Context) error {
return nil
}
// genReqID generates a unique id for import request, this method has no lock, should only be called by importJob()
func (m *importManager) genReqID() int64 {
if m.lastReqID == 0 {
m.lastReqID = time.Now().Unix()
} else {
id := time.Now().Unix()
if id == m.lastReqID {
id++
}
m.lastReqID = id
}
return m.lastReqID
}
// importJob processes the import request, generates import tasks, sends these tasks to DataCoord, and returns
// immediately.
func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportRequest, cID int64, pID int64) *milvuspb.ImportResponse {
......@@ -297,7 +281,6 @@ func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportReque
}
}
reqID := m.genReqID()
// convert import request to import tasks
if req.RowBased {
// For row-based importing, each file makes a task.
......@@ -309,7 +292,6 @@ func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportReque
}
newTask := &datapb.ImportTaskInfo{
Id: tID,
RequestId: reqID,
CollectionId: cID,
PartitionId: pID,
ChannelNames: req.ChannelNames,
......@@ -329,7 +311,7 @@ func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportReque
m.pendingTasks = append(m.pendingTasks, newTask)
m.storeImportTask(newTask)
}
log.Info("row-based import request processed", zap.Int64("reqID", reqID), zap.Any("taskIDs", taskList))
log.Info("row-based import request processed", zap.Any("taskIDs", taskList))
} else {
// TODO: Merge duplicated code :(
// for column-based, all files is a task
......@@ -339,7 +321,6 @@ func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportReque
}
newTask := &datapb.ImportTaskInfo{
Id: tID,
RequestId: reqID,
CollectionId: cID,
PartitionId: pID,
ChannelNames: req.ChannelNames,
......@@ -357,7 +338,7 @@ func (m *importManager) importJob(ctx context.Context, req *milvuspb.ImportReque
log.Info("new task created as pending task", zap.Int64("task ID", newTask.GetId()))
m.pendingTasks = append(m.pendingTasks, newTask)
m.storeImportTask(newTask)
log.Info("column-based import request processed", zap.Int64("reqID", reqID), zap.Int64("taskID", newTask.GetId()))
log.Info("column-based import request processed", zap.Int64("taskID", newTask.GetId()))
}
return nil
}()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册