Set search graceful time from config (#5014)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/5026/head
bigsheeper 2021-04-24 15:53:37 +08:00 committed by GitHub
parent 746fc556a0
commit c4b379be8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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:

View File

@ -52,7 +52,7 @@ proxyService:
port: 21122
queryNode:
gracefulTime: 5000 # ms, for search
gracefulTime: 1000 # ms, for search
port: 21123
indexService:

View File

@ -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()
}