impl.go 18.4 KB
Newer Older
1 2 3 4 5 6
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
7 8
// with the License. You may obtain a copy of the License at
//
9
//     http://www.apache.org/licenses/LICENSE-2.0
10
//
11 12 13 14 15
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
16

17 18 19 20
package querynode

import (
	"context"
21
	"fmt"
22 23 24

	"go.uber.org/zap"

25
	"github.com/milvus-io/milvus/internal/common"
X
Xiangyu Wang 已提交
26 27 28 29 30
	"github.com/milvus-io/milvus/internal/log"
	"github.com/milvus-io/milvus/internal/proto/commonpb"
	"github.com/milvus-io/milvus/internal/proto/internalpb"
	"github.com/milvus-io/milvus/internal/proto/milvuspb"
	queryPb "github.com/milvus-io/milvus/internal/proto/querypb"
31
	"github.com/milvus-io/milvus/internal/util/metricsinfo"
X
Xiangyu Wang 已提交
32
	"github.com/milvus-io/milvus/internal/util/typeutil"
33 34
)

35
// GetComponentStates returns information about whether the node is healthy
36
func (node *QueryNode) GetComponentStates(ctx context.Context) (*internalpb.ComponentStates, error) {
37
	log.Debug("Get QueryNode component states")
38 39 40 41 42
	stats := &internalpb.ComponentStates{
		Status: &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		},
	}
43 44 45
	code, ok := node.stateCode.Load().(internalpb.StateCode)
	if !ok {
		errMsg := "unexpected error in type assertion"
46 47
		stats.Status = &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
48
			Reason:    errMsg,
49
		}
G
godchen 已提交
50
		return stats, nil
51 52 53 54
	}
	nodeID := common.NotRegisteredID
	if node.session != nil && node.session.Registered() {
		nodeID = node.session.ServerID
55 56
	}
	info := &internalpb.ComponentInfo{
57
		NodeID:    nodeID,
58 59 60 61
		Role:      typeutil.QueryNodeRole,
		StateCode: code,
	}
	stats.State = info
62
	log.Debug("Get QueryNode component state done", zap.Any("stateCode", info.StateCode))
63 64 65
	return stats, nil
}

66 67
// GetTimeTickChannel returns the time tick channel
// TimeTickChannel contains many time tick messages, which will be sent by query nodes
68 69 70 71 72 73
func (node *QueryNode) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
	return &milvuspb.StringResponse{
		Status: &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
			Reason:    "",
		},
74
		Value: Params.QueryNodeCfg.QueryTimeTickChannelName,
75 76 77
	}, nil
}

78
// GetStatisticsChannel returns the statistics channel
79
// Statistics channel contains statistics infos of query nodes, such as segment infos, memory infos
80 81 82 83 84 85
func (node *QueryNode) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
	return &milvuspb.StringResponse{
		Status: &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
			Reason:    "",
		},
86
		Value: Params.QueryNodeCfg.StatsChannelName,
87 88 89
	}, nil
}

90
// AddQueryChannel watch queryChannel of the collection to receive query message
91
func (node *QueryNode) AddQueryChannel(ctx context.Context, in *queryPb.AddQueryChannelRequest) (*commonpb.Status, error) {
92 93
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
94
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
95 96 97 98
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
99
		return status, nil
100
	}
101 102 103 104 105 106 107
	dct := &addQueryChannelTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
108
	}
109

110
	err := node.scheduler.queue.Enqueue(dct)
111 112 113 114
	if err != nil {
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
115
		}
116
		log.Error(err.Error())
G
godchen 已提交
117
		return status, nil
118
	}
119
	log.Debug("addQueryChannelTask Enqueue done", zap.Any("collectionID", in.CollectionID))
120

121 122 123 124 125 126
	waitFunc := func() (*commonpb.Status, error) {
		err = dct.WaitToFinish()
		if err != nil {
			status := &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
127
			}
128
			log.Error(err.Error())
G
godchen 已提交
129
			return status, nil
130
		}
131 132 133 134
		log.Debug("addQueryChannelTask WaitToFinish done", zap.Any("collectionID", in.CollectionID))
		return &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		}, nil
135
	}
136

137
	return waitFunc()
138 139
}

140
// RemoveQueryChannel remove queryChannel of the collection to stop receiving query message
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
func (node *QueryNode) RemoveQueryChannel(ctx context.Context, in *queryPb.RemoveQueryChannelRequest) (*commonpb.Status, error) {
	// if node.searchService == nil || node.searchService.searchMsgStream == nil {
	// 	errMsg := "null search service or null search result message stream"
	// 	status := &commonpb.Status{
	// 		ErrorCode: commonpb.ErrorCode_UnexpectedError,
	// 		Reason:    errMsg,
	// 	}

	// 	return status, errors.New(errMsg)
	// }

	// searchStream, ok := node.searchService.searchMsgStream.(*pulsarms.PulsarMsgStream)
	// if !ok {
	// 	errMsg := "type assertion failed for search message stream"
	// 	status := &commonpb.Status{
	// 		ErrorCode: commonpb.ErrorCode_UnexpectedError,
	// 		Reason:    errMsg,
	// 	}

	// 	return status, errors.New(errMsg)
	// }

	// resultStream, ok := node.searchService.searchResultMsgStream.(*pulsarms.PulsarMsgStream)
	// if !ok {
	// 	errMsg := "type assertion failed for search result message stream"
	// 	status := &commonpb.Status{
	// 		ErrorCode: commonpb.ErrorCode_UnexpectedError,
	// 		Reason:    errMsg,
	// 	}

	// 	return status, errors.New(errMsg)
	// }

	// // remove request channel
	// consumeChannels := []string{in.RequestChannelID}
	// consumeSubName := Params.MsgChannelSubName
	// // TODO: searchStream.RemovePulsarConsumers(producerChannels)
	// searchStream.AsConsumer(consumeChannels, consumeSubName)

	// // remove result channel
	// producerChannels := []string{in.ResultChannelID}
	// // TODO: resultStream.RemovePulsarProducer(producerChannels)
	// resultStream.AsProducer(producerChannels)

	status := &commonpb.Status{
		ErrorCode: commonpb.ErrorCode_Success,
	}
	return status, nil
}

191
// WatchDmChannels create consumers on dmChannels to reveive Incremental data,which is the important part of real-time query
192
func (node *QueryNode) WatchDmChannels(ctx context.Context, in *queryPb.WatchDmChannelsRequest) (*commonpb.Status, error) {
193 194
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
195
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
196 197 198 199
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
200
		return status, nil
201
	}
202 203 204 205 206 207 208
	dct := &watchDmChannelsTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
209 210
	}

211 212
	err := node.scheduler.queue.Enqueue(dct)
	if err != nil {
213 214
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
215
			Reason:    err.Error(),
216
		}
217
		log.Error(err.Error())
G
godchen 已提交
218
		return status, nil
219
	}
220
	log.Debug("watchDmChannelsTask Enqueue done", zap.Any("collectionID", in.CollectionID))
221

222
	waitFunc := func() (*commonpb.Status, error) {
223
		err = dct.WaitToFinish()
224
		if err != nil {
225 226 227 228
			status := &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			}
229
			log.Error(err.Error())
G
godchen 已提交
230
			return status, nil
231
		}
232
		log.Debug("watchDmChannelsTask WaitToFinish done", zap.Any("collectionID", in.CollectionID))
233 234 235
		return &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		}, nil
236
	}
237 238

	return waitFunc()
239 240
}

G
godchen 已提交
241
// WatchDeltaChannels create consumers on dmChannels to receive Incremental data,which is the important part of real-time query
242
func (node *QueryNode) WatchDeltaChannels(ctx context.Context, in *queryPb.WatchDeltaChannelsRequest) (*commonpb.Status, error) {
243 244
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
245
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
246 247 248 249
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
250
		return status, nil
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
	}
	dct := &watchDeltaChannelsTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
	}

	err := node.scheduler.queue.Enqueue(dct)
	if err != nil {
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
267
		log.Error(err.Error())
G
godchen 已提交
268
		return status, nil
269 270 271 272 273 274 275 276 277 278
	}
	log.Debug("watchDeltaChannelsTask Enqueue done", zap.Any("collectionID", in.CollectionID))

	waitFunc := func() (*commonpb.Status, error) {
		err = dct.WaitToFinish()
		if err != nil {
			status := &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			}
279
			log.Error(err.Error())
G
godchen 已提交
280
			return status, nil
281 282 283 284 285 286 287 288
		}
		log.Debug("watchDeltaChannelsTask WaitToFinish done", zap.Any("collectionID", in.CollectionID))
		return &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		}, nil
	}

	return waitFunc()
289 290
}

291
// LoadSegments load historical data into query node, historical data can be vector data or index
292
func (node *QueryNode) LoadSegments(ctx context.Context, in *queryPb.LoadSegmentsRequest) (*commonpb.Status, error) {
293 294
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
295
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
296 297 298 299
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
300
		return status, nil
301
	}
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
	dct := &loadSegmentsTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
	}

	err := node.scheduler.queue.Enqueue(dct)
	if err != nil {
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
317
		log.Error(err.Error())
G
godchen 已提交
318
		return status, nil
319
	}
320 321 322 323 324
	segmentIDs := make([]UniqueID, 0)
	for _, info := range in.Infos {
		segmentIDs = append(segmentIDs, info.SegmentID)
	}
	log.Debug("loadSegmentsTask Enqueue done", zap.Int64s("segmentIDs", segmentIDs))
325

326
	waitFunc := func() (*commonpb.Status, error) {
327 328
		err = dct.WaitToFinish()
		if err != nil {
329 330 331 332
			status := &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			}
333
			log.Error(err.Error())
G
godchen 已提交
334
			return status, nil
335
		}
336
		log.Debug("loadSegmentsTask WaitToFinish done", zap.Int64s("segmentIDs", segmentIDs))
337 338 339
		return &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		}, nil
340
	}
341 342

	return waitFunc()
343 344
}

G
godchen 已提交
345
// ReleaseCollection clears all data related to this collection on the querynode
346
func (node *QueryNode) ReleaseCollection(ctx context.Context, in *queryPb.ReleaseCollectionRequest) (*commonpb.Status, error) {
347 348
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
349
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
350 351 352 353
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
354
		return status, nil
355
	}
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
	dct := &releaseCollectionTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
	}

	err := node.scheduler.queue.Enqueue(dct)
	if err != nil {
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
371
		log.Error(err.Error())
G
godchen 已提交
372
		return status, nil
373 374 375
	}
	log.Debug("releaseCollectionTask Enqueue done", zap.Any("collectionID", in.CollectionID))

376
	func() {
377 378
		err = dct.WaitToFinish()
		if err != nil {
379
			log.Error(err.Error())
380
			return
381
		}
382 383
		log.Debug("releaseCollectionTask WaitToFinish done", zap.Any("collectionID", in.CollectionID))
	}()
384 385 386 387 388 389 390

	status := &commonpb.Status{
		ErrorCode: commonpb.ErrorCode_Success,
	}
	return status, nil
}

391
// ReleasePartitions clears all data related to this partition on the querynode
392
func (node *QueryNode) ReleasePartitions(ctx context.Context, in *queryPb.ReleasePartitionsRequest) (*commonpb.Status, error) {
393 394
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
395
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
396 397 398 399
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
400
		return status, nil
401
	}
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
	dct := &releasePartitionsTask{
		baseTask: baseTask{
			ctx:  ctx,
			done: make(chan error),
		},
		req:  in,
		node: node,
	}

	err := node.scheduler.queue.Enqueue(dct)
	if err != nil {
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
417
		log.Error(err.Error())
G
godchen 已提交
418
		return status, nil
419 420 421
	}
	log.Debug("releasePartitionsTask Enqueue done", zap.Any("collectionID", in.CollectionID))

422
	func() {
423 424
		err = dct.WaitToFinish()
		if err != nil {
425
			log.Error(err.Error())
426
			return
427
		}
428 429
		log.Debug("releasePartitionsTask WaitToFinish done", zap.Any("collectionID", in.CollectionID))
	}()
430 431 432 433 434 435 436

	status := &commonpb.Status{
		ErrorCode: commonpb.ErrorCode_Success,
	}
	return status, nil
}

437
// ReleaseSegments remove the specified segments from query node according segmentIDs, partitionIDs, and collectionID
438
func (node *QueryNode) ReleaseSegments(ctx context.Context, in *queryPb.ReleaseSegmentsRequest) (*commonpb.Status, error) {
439 440
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
441
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
442 443 444 445
		status := &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    err.Error(),
		}
G
godchen 已提交
446
		return status, nil
447
	}
448 449 450 451
	status := &commonpb.Status{
		ErrorCode: commonpb.ErrorCode_Success,
	}
	for _, id := range in.SegmentIDs {
452 453 454 455 456 457 458 459
		err := node.historical.replica.removeSegment(id)
		if err != nil {
			// not return, try to release all segments
			status.ErrorCode = commonpb.ErrorCode_UnexpectedError
			status.Reason = err.Error()
		}
		err = node.streaming.replica.removeSegment(id)
		if err != nil {
460 461
			// not return, try to release all segments
			status.ErrorCode = commonpb.ErrorCode_UnexpectedError
462
			status.Reason = err.Error()
463 464 465 466 467
		}
	}
	return status, nil
}

468
// GetSegmentInfo returns segment information of the collection on the queryNode, and the information includes memSize, numRow, indexName, indexID ...
469
func (node *QueryNode) GetSegmentInfo(ctx context.Context, in *queryPb.GetSegmentInfoRequest) (*queryPb.GetSegmentInfoResponse, error) {
470 471
	code := node.stateCode.Load().(internalpb.StateCode)
	if code != internalpb.StateCode_Healthy {
472
		err := fmt.Errorf("query node %d is not ready", Params.QueryNodeCfg.QueryNodeID)
473 474 475 476 477 478
		res := &queryPb.GetSegmentInfoResponse{
			Status: &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			},
		}
G
godchen 已提交
479
		return res, nil
480
	}
481
	infos := make([]*queryPb.SegmentInfo, 0)
482

483
	// get info from historical
484
	// node.historical.replica.printReplica()
485
	historicalSegmentInfos, err := node.historical.replica.getSegmentInfosByColID(in.CollectionID)
486
	if err != nil {
487
		log.Debug("GetSegmentInfo: get historical segmentInfo failed", zap.Int64("collectionID", in.CollectionID), zap.Error(err))
488 489 490 491 492 493
		res := &queryPb.GetSegmentInfoResponse{
			Status: &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			},
		}
G
godchen 已提交
494
		return res, nil
495
	}
496
	infos = append(infos, historicalSegmentInfos...)
497

498
	// get info from streaming
499
	// node.streaming.replica.printReplica()
500
	streamingSegmentInfos, err := node.streaming.replica.getSegmentInfosByColID(in.CollectionID)
501
	if err != nil {
502
		log.Debug("GetSegmentInfo: get streaming segmentInfo failed", zap.Int64("collectionID", in.CollectionID), zap.Error(err))
503 504 505 506 507 508
		res := &queryPb.GetSegmentInfoResponse{
			Status: &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			},
		}
G
godchen 已提交
509
		return res, nil
510
	}
511
	infos = append(infos, streamingSegmentInfos...)
512
	// log.Debug("GetSegmentInfo: get segment info from query node", zap.Int64("nodeID", node.session.ServerID), zap.Any("segment infos", infos))
513

514 515 516 517 518 519 520
	return &queryPb.GetSegmentInfoResponse{
		Status: &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_Success,
		},
		Infos: infos,
	}, nil
}
521 522 523 524 525 526

func (node *QueryNode) isHealthy() bool {
	code := node.stateCode.Load().(internalpb.StateCode)
	return code == internalpb.StateCode_Healthy
}

G
godchen 已提交
527
// GetMetrics return system infos of the query node, such as total memory, memory usage, cpu usage ...
528
// TODO(dragondriver): cache the Metrics and set a retention to the cache
529 530
func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
	log.Debug("QueryNode.GetMetrics",
531
		zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID),
532 533 534 535
		zap.String("req", req.Request))

	if !node.isHealthy() {
		log.Warn("QueryNode.GetMetrics failed",
536
			zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID),
537
			zap.String("req", req.Request),
538
			zap.Error(errQueryNodeIsUnhealthy(Params.QueryNodeCfg.QueryNodeID)))
539 540 541 542

		return &milvuspb.GetMetricsResponse{
			Status: &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
543
				Reason:    msgQueryNodeIsUnhealthy(Params.QueryNodeCfg.QueryNodeID),
544 545 546 547 548 549 550 551
			},
			Response: "",
		}, nil
	}

	metricType, err := metricsinfo.ParseMetricType(req.Request)
	if err != nil {
		log.Warn("QueryNode.GetMetrics failed to parse metric type",
552
			zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID),
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
			zap.String("req", req.Request),
			zap.Error(err))

		return &milvuspb.GetMetricsResponse{
			Status: &commonpb.Status{
				ErrorCode: commonpb.ErrorCode_UnexpectedError,
				Reason:    err.Error(),
			},
			Response: "",
		}, nil
	}

	log.Debug("QueryNode.GetMetrics",
		zap.String("metric_type", metricType))

	if metricType == metricsinfo.SystemInfoMetrics {
		metrics, err := getSystemInfoMetrics(ctx, req, node)

		log.Debug("QueryNode.GetMetrics",
572
			zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID),
573 574 575 576 577
			zap.String("req", req.Request),
			zap.String("metric_type", metricType),
			zap.Any("metrics", metrics), // TODO(dragondriver): necessary? may be very large
			zap.Error(err))

G
godchen 已提交
578
		return metrics, nil
579 580 581
	}

	log.Debug("QueryNode.GetMetrics failed, request metric type is not implemented yet",
582
		zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID),
583 584 585 586 587 588 589 590 591 592 593
		zap.String("req", req.Request),
		zap.String("metric_type", metricType))

	return &milvuspb.GetMetricsResponse{
		Status: &commonpb.Status{
			ErrorCode: commonpb.ErrorCode_UnexpectedError,
			Reason:    metricsinfo.MsgUnimplementedMetric,
		},
		Response: "",
	}, nil
}