From cc4ab78f1479d9769ca5c03f4e556b0b2b88bd06 Mon Sep 17 00:00:00 2001 From: Erez Louidor Date: Tue, 21 Mar 2017 16:24:28 -0700 Subject: [PATCH] Removing the cap on the # of iterations of SplitQuery. --- .../tabletserver/splitquery/full_scan_algorithm.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/go/vt/vttablet/tabletserver/splitquery/full_scan_algorithm.go b/go/vt/vttablet/tabletserver/splitquery/full_scan_algorithm.go index b2c406895ce..b9ba8b598b1 100644 --- a/go/vt/vttablet/tabletserver/splitquery/full_scan_algorithm.go +++ b/go/vt/vttablet/tabletserver/splitquery/full_scan_algorithm.go @@ -77,14 +77,11 @@ func (a *FullScanAlgorithm) generateBoundaries() ([]tuple, error) { } result := make([]tuple, 0, a.splitParams.splitCount) var iteration int64 - // We have to allow for more than splitCount query-parts since we use an estimated - // tableSize in the equation 'numRowsPerQueryPart * splitCount = tableSize'. - maxIterations := 10 * a.splitParams.splitCount + // We used to have a safety check that makes sure the number of iterations does not + // exceed 10*a.splitParams.splitCount. The splitCount parameter was calculated from + // the estimated number of rows in the information schema, which could have been grossly + // inaccurate (more than 10 times too low). for iteration = 0; prevTuple != nil; iteration++ { - if iteration > maxIterations { - panic(fmt.Sprintf("splitquery.FullScanAlgorithm.generateBoundaries(): didn't terminate"+ - " after %v iterations (=10*splitCount). FullScanAlgorithm: %v", maxIterations, a)) - } result = append(result, prevTuple) a.populatePrevTupleInBindVariables(prevTuple, a.noninitialQuery.BindVariables) prevTuple, err = a.executeQuery(a.noninitialQuery)