vmselect: fix result collect count (#4599)

This commit is contained in:
Haleygo 2023-07-08 14:21:27 +08:00 committed by GitHub
parent 173ccf4333
commit 14e242d0b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1729,7 +1729,6 @@ func (snr *storageNodesRequest) collectResults(partialResultsCounter *metrics.Co
result := <-snr.resultsCh
if err := f(result.data); err != nil {
snr.finishQueryTracer(result.qt, fmt.Sprintf("error: %s", err))
resultsCollected++
if *skipSlowReplicas && resultsCollected > len(sns)-*replicationFactor {
// There is no need in waiting for the remaining results,
// because the collected results contain all the data according to the given -replicationFactor.
@ -1767,6 +1766,7 @@ func (snr *storageNodesRequest) collectResults(partialResultsCounter *metrics.Co
continue
}
snr.finishQueryTracer(result.qt, "")
resultsCollected++
}
if len(errsPartial) < *replicationFactor {
// Assume that the result is full if the the number of failing vmstorage nodes