mirror of https://github.com/milvus-io/milvus.git
Set search graceful time from config (#5014)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/5026/head
parent
746fc556a0
commit
c4b379be8b
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# 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.
|
||||
|
||||
dataservice:
|
||||
nodeID: 14040
|
||||
segment:
|
||||
|
|
|
@ -52,7 +52,7 @@ proxyService:
|
|||
port: 21122
|
||||
|
||||
queryNode:
|
||||
gracefulTime: 5000 # ms, for search
|
||||
gracefulTime: 1000 # ms, for search
|
||||
port: 21123
|
||||
|
||||
indexService:
|
||||
|
|
|
@ -121,9 +121,13 @@ func (s *searchCollection) getServiceableTime() Timestamp {
|
|||
|
||||
func (s *searchCollection) setServiceableTime(t Timestamp) {
|
||||
s.serviceableTimeMutex.Lock()
|
||||
// hard code graceful time to 1 second
|
||||
// TODO: use config to set graceful time
|
||||
s.serviceableTime = t + 1000*1000*1000
|
||||
gracefulTimeInMilliSecond := Params.GracefulTime
|
||||
if gracefulTimeInMilliSecond > 0 {
|
||||
gracefulTime := tsoutil.ComposeTS(gracefulTimeInMilliSecond, 0)
|
||||
s.serviceableTime = t + gracefulTime
|
||||
} else {
|
||||
s.serviceableTime = t
|
||||
}
|
||||
s.serviceableTimeMutex.Unlock()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue