diff --git a/cmd/explaintest/r/tpch.result b/cmd/explaintest/r/tpch.result index 11a84495b2b37..addf03e16b5b8 100644 --- a/cmd/explaintest/r/tpch.result +++ b/cmd/explaintest/r/tpch.result @@ -447,8 +447,8 @@ l_year; id estRows task access object operator info Sort 769.96 root tpch.nation.n_name, tpch.nation.n_name, Column#50 └─Projection 769.96 root tpch.nation.n_name, tpch.nation.n_name, Column#50, Column#52 - └─HashAgg 769.96 root group by:Column#50, tpch.nation.n_name, tpch.nation.n_name, funcs:sum(Column#51)->Column#52, funcs:firstrow(tpch.nation.n_name)->tpch.nation.n_name, funcs:firstrow(tpch.nation.n_name)->tpch.nation.n_name, funcs:firstrow(Column#50)->Column#50 - └─Projection 1957240.42 root tpch.nation.n_name, tpch.nation.n_name, extract(YEAR, tpch.lineitem.l_shipdate)->Column#50, mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount))->Column#51 + └─HashAgg 769.96 root group by:Column#59, Column#60, Column#61, funcs:sum(Column#55)->Column#52, funcs:firstrow(Column#56)->tpch.nation.n_name, funcs:firstrow(Column#57)->tpch.nation.n_name, funcs:firstrow(Column#58)->Column#50 + └─Projection 1957240.42 root mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount))->Column#55, tpch.nation.n_name, tpch.nation.n_name, extract(YEAR, tpch.lineitem.l_shipdate)->Column#58, tpch.nation.n_name, tpch.nation.n_name, extract(YEAR, tpch.lineitem.l_shipdate)->Column#61 └─Projection 1957240.42 root tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.lineitem.l_shipdate, tpch.nation.n_name, tpch.nation.n_name └─HashJoin 1957240.42 root inner join, equal:[eq(tpch.customer.c_nationkey, tpch.nation.n_nationkey)], other cond:or(and(eq(tpch.nation.n_name, "JAPAN"), eq(tpch.nation.n_name, "INDIA")), and(eq(tpch.nation.n_name, "INDIA"), eq(tpch.nation.n_name, "JAPAN"))) ├─TableReader(Build) 2.00 root data:Selection @@ -521,36 +521,35 @@ id estRows task access object operator info Sort 719.02 root Column#62 └─Projection 719.02 root Column#62, div(Column#64, Column#65)->Column#66 └─HashAgg 719.02 root group by:Column#78, funcs:sum(Column#75)->Column#64, funcs:sum(Column#76)->Column#65, funcs:firstrow(Column#77)->Column#62 - └─Projection 563136.02 root case(eq(tpch.nation.n_name, INDIA), Column#63, 0)->Column#75, Column#63, Column#62, Column#62 - └─Projection 563136.02 root extract(YEAR, tpch.orders.o_orderdate)->Column#62, mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount))->Column#63, tpch.nation.n_name - └─Projection 563136.02 root tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.orders.o_orderdate, tpch.nation.n_name - └─HashJoin 563136.02 root inner join, equal:[eq(tpch.supplier.s_nationkey, tpch.nation.n_nationkey)] - ├─TableReader(Build) 25.00 root data:TableFullScan - │ └─TableFullScan 25.00 cop[tikv] table:n2 keep order:false - └─HashJoin(Probe) 563136.02 root inner join, equal:[eq(tpch.lineitem.l_suppkey, tpch.supplier.s_suppkey)] - ├─TableReader(Build) 500000.00 root data:TableFullScan - │ └─TableFullScan 500000.00 cop[tikv] table:supplier keep order:false - └─HashJoin(Probe) 563136.02 root inner join, equal:[eq(tpch.lineitem.l_partkey, tpch.part.p_partkey)] - ├─TableReader(Build) 61674.00 root data:Selection - │ └─Selection 61674.00 cop[tikv] eq(tpch.part.p_type, "SMALL PLATED COPPER") - │ └─TableFullScan 10000000.00 cop[tikv] table:part keep order:false - └─IndexHashJoin(Probe) 90788402.51 root inner join, inner:IndexLookUp, outer key:tpch.orders.o_orderkey, inner key:tpch.lineitem.l_orderkey, equal cond:eq(tpch.orders.o_orderkey, tpch.lineitem.l_orderkey) - ├─HashJoin(Build) 22413367.93 root inner join, equal:[eq(tpch.customer.c_custkey, tpch.orders.o_custkey)] - │ ├─HashJoin(Build) 1500000.00 root inner join, equal:[eq(tpch.nation.n_nationkey, tpch.customer.c_nationkey)] - │ │ ├─HashJoin(Build) 5.00 root inner join, equal:[eq(tpch.region.r_regionkey, tpch.nation.n_regionkey)] - │ │ │ ├─TableReader(Build) 1.00 root data:Selection - │ │ │ │ └─Selection 1.00 cop[tikv] eq(tpch.region.r_name, "ASIA") - │ │ │ │ └─TableFullScan 5.00 cop[tikv] table:region keep order:false - │ │ │ └─TableReader(Probe) 25.00 root data:TableFullScan - │ │ │ └─TableFullScan 25.00 cop[tikv] table:n1 keep order:false - │ │ └─TableReader(Probe) 7500000.00 root data:TableFullScan - │ │ └─TableFullScan 7500000.00 cop[tikv] table:customer keep order:false - │ └─TableReader(Probe) 22413367.93 root data:Selection - │ └─Selection 22413367.93 cop[tikv] ge(tpch.orders.o_orderdate, 1995-01-01 00:00:00.000000), le(tpch.orders.o_orderdate, 1996-12-31 00:00:00.000000) - │ └─TableFullScan 75000000.00 cop[tikv] table:orders keep order:false - └─IndexLookUp(Probe) 4.05 root - ├─IndexRangeScan(Build) 4.05 cop[tikv] table:lineitem, index:PRIMARY(L_ORDERKEY, L_LINENUMBER) range: decided by [eq(tpch.lineitem.l_orderkey, tpch.orders.o_orderkey)], keep order:false - └─TableRowIDScan(Probe) 4.05 cop[tikv] table:lineitem keep order:false + └─Projection 563136.02 root case(eq(tpch.nation.n_name, INDIA), mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount)), 0)->Column#75, mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount))->Column#76, extract(YEAR, tpch.orders.o_orderdate)->Column#77, extract(YEAR, tpch.orders.o_orderdate)->Column#78 + └─Projection 563136.02 root tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.orders.o_orderdate, tpch.nation.n_name + └─HashJoin 563136.02 root inner join, equal:[eq(tpch.supplier.s_nationkey, tpch.nation.n_nationkey)] + ├─TableReader(Build) 25.00 root data:TableFullScan + │ └─TableFullScan 25.00 cop[tikv] table:n2 keep order:false + └─HashJoin(Probe) 563136.02 root inner join, equal:[eq(tpch.lineitem.l_suppkey, tpch.supplier.s_suppkey)] + ├─TableReader(Build) 500000.00 root data:TableFullScan + │ └─TableFullScan 500000.00 cop[tikv] table:supplier keep order:false + └─HashJoin(Probe) 563136.02 root inner join, equal:[eq(tpch.lineitem.l_partkey, tpch.part.p_partkey)] + ├─TableReader(Build) 61674.00 root data:Selection + │ └─Selection 61674.00 cop[tikv] eq(tpch.part.p_type, "SMALL PLATED COPPER") + │ └─TableFullScan 10000000.00 cop[tikv] table:part keep order:false + └─IndexHashJoin(Probe) 90788402.51 root inner join, inner:IndexLookUp, outer key:tpch.orders.o_orderkey, inner key:tpch.lineitem.l_orderkey, equal cond:eq(tpch.orders.o_orderkey, tpch.lineitem.l_orderkey) + ├─HashJoin(Build) 22413367.93 root inner join, equal:[eq(tpch.customer.c_custkey, tpch.orders.o_custkey)] + │ ├─HashJoin(Build) 1500000.00 root inner join, equal:[eq(tpch.nation.n_nationkey, tpch.customer.c_nationkey)] + │ │ ├─HashJoin(Build) 5.00 root inner join, equal:[eq(tpch.region.r_regionkey, tpch.nation.n_regionkey)] + │ │ │ ├─TableReader(Build) 1.00 root data:Selection + │ │ │ │ └─Selection 1.00 cop[tikv] eq(tpch.region.r_name, "ASIA") + │ │ │ │ └─TableFullScan 5.00 cop[tikv] table:region keep order:false + │ │ │ └─TableReader(Probe) 25.00 root data:TableFullScan + │ │ │ └─TableFullScan 25.00 cop[tikv] table:n1 keep order:false + │ │ └─TableReader(Probe) 7500000.00 root data:TableFullScan + │ │ └─TableFullScan 7500000.00 cop[tikv] table:customer keep order:false + │ └─TableReader(Probe) 22413367.93 root data:Selection + │ └─Selection 22413367.93 cop[tikv] ge(tpch.orders.o_orderdate, 1995-01-01 00:00:00.000000), le(tpch.orders.o_orderdate, 1996-12-31 00:00:00.000000) + │ └─TableFullScan 75000000.00 cop[tikv] table:orders keep order:false + └─IndexLookUp(Probe) 4.05 root + ├─IndexRangeScan(Build) 4.05 cop[tikv] table:lineitem, index:PRIMARY(L_ORDERKEY, L_LINENUMBER) range: decided by [eq(tpch.lineitem.l_orderkey, tpch.orders.o_orderkey)], keep order:false + └─TableRowIDScan(Probe) 4.05 cop[tikv] table:lineitem keep order:false /* Q9 Product Type Profit Measure Query This query determines how much profit is made on a given line of parts, broken out by supplier nation and year. @@ -597,8 +596,8 @@ o_year desc; id estRows task access object operator info Sort 2406.00 root tpch.nation.n_name, Column#53:desc └─Projection 2406.00 root tpch.nation.n_name, Column#53, Column#55 - └─HashAgg 2406.00 root group by:Column#53, tpch.nation.n_name, funcs:sum(Column#54)->Column#55, funcs:firstrow(tpch.nation.n_name)->tpch.nation.n_name, funcs:firstrow(Column#53)->Column#53 - └─Projection 241379546.70 root tpch.nation.n_name, extract(YEAR, tpch.orders.o_orderdate)->Column#53, minus(mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount)), mul(tpch.partsupp.ps_supplycost, tpch.lineitem.l_quantity))->Column#54 + └─HashAgg 2406.00 root group by:Column#67, Column#68, funcs:sum(Column#64)->Column#55, funcs:firstrow(Column#65)->tpch.nation.n_name, funcs:firstrow(Column#66)->Column#53 + └─Projection 241379546.70 root minus(mul(tpch.lineitem.l_extendedprice, minus(1, tpch.lineitem.l_discount)), mul(tpch.partsupp.ps_supplycost, tpch.lineitem.l_quantity))->Column#64, tpch.nation.n_name, extract(YEAR, tpch.orders.o_orderdate)->Column#66, tpch.nation.n_name, extract(YEAR, tpch.orders.o_orderdate)->Column#68 └─Projection 241379546.70 root tpch.lineitem.l_quantity, tpch.lineitem.l_extendedprice, tpch.lineitem.l_discount, tpch.partsupp.ps_supplycost, tpch.orders.o_orderdate, tpch.nation.n_name └─HashJoin 241379546.70 root inner join, equal:[eq(tpch.lineitem.l_orderkey, tpch.orders.o_orderkey)] ├─TableReader(Build) 75000000.00 root data:TableFullScan @@ -1160,20 +1159,19 @@ Sort 20000.00 root tpch.supplier.s_name │ └─TableReader(Probe) 500000.00 root data:TableFullScan │ └─TableFullScan 500000.00 cop[tikv] table:supplier keep order:false └─HashAgg(Probe) 257492.04 root group by:tpch.partsupp.ps_suppkey, funcs:firstrow(tpch.partsupp.ps_suppkey)->tpch.partsupp.ps_suppkey - └─Projection 257492.04 root tpch.partsupp.ps_suppkey - └─Selection 257492.04 root gt(cast(tpch.partsupp.ps_availqty, decimal(20,0) BINARY), mul(0.5, Column#44)) - └─HashAgg 321865.05 root group by:tpch.partsupp.ps_partkey, tpch.partsupp.ps_suppkey, funcs:firstrow(tpch.partsupp.ps_suppkey)->tpch.partsupp.ps_suppkey, funcs:firstrow(tpch.partsupp.ps_availqty)->tpch.partsupp.ps_availqty, funcs:sum(tpch.lineitem.l_quantity)->Column#44 - └─HashJoin 9711455.06 root left outer join, equal:[eq(tpch.partsupp.ps_partkey, tpch.lineitem.l_partkey) eq(tpch.partsupp.ps_suppkey, tpch.lineitem.l_suppkey)] - ├─IndexHashJoin(Build) 321865.05 root inner join, inner:IndexLookUp, outer key:tpch.part.p_partkey, inner key:tpch.partsupp.ps_partkey, equal cond:eq(tpch.part.p_partkey, tpch.partsupp.ps_partkey) - │ ├─TableReader(Build) 80007.93 root data:Selection - │ │ └─Selection 80007.93 cop[tikv] like(tpch.part.p_name, "green%", 92) - │ │ └─TableFullScan 10000000.00 cop[tikv] table:part keep order:false - │ └─IndexLookUp(Probe) 4.02 root - │ ├─IndexRangeScan(Build) 4.02 cop[tikv] table:partsupp, index:PRIMARY(PS_PARTKEY, PS_SUPPKEY) range: decided by [eq(tpch.partsupp.ps_partkey, tpch.part.p_partkey)], keep order:false - │ └─TableRowIDScan(Probe) 4.02 cop[tikv] table:partsupp keep order:false - └─TableReader(Probe) 44189356.65 root data:Selection - └─Selection 44189356.65 cop[tikv] ge(tpch.lineitem.l_shipdate, 1993-01-01 00:00:00.000000), lt(tpch.lineitem.l_shipdate, 1994-01-01) - └─TableFullScan 300005811.00 cop[tikv] table:lineitem keep order:false + └─Selection 257492.04 root gt(cast(tpch.partsupp.ps_availqty, decimal(20,0) BINARY), mul(0.5, Column#44)) + └─HashAgg 321865.05 root group by:tpch.partsupp.ps_partkey, tpch.partsupp.ps_suppkey, funcs:firstrow(tpch.partsupp.ps_suppkey)->tpch.partsupp.ps_suppkey, funcs:firstrow(tpch.partsupp.ps_availqty)->tpch.partsupp.ps_availqty, funcs:sum(tpch.lineitem.l_quantity)->Column#44 + └─HashJoin 9711455.06 root left outer join, equal:[eq(tpch.partsupp.ps_partkey, tpch.lineitem.l_partkey) eq(tpch.partsupp.ps_suppkey, tpch.lineitem.l_suppkey)] + ├─IndexHashJoin(Build) 321865.05 root inner join, inner:IndexLookUp, outer key:tpch.part.p_partkey, inner key:tpch.partsupp.ps_partkey, equal cond:eq(tpch.part.p_partkey, tpch.partsupp.ps_partkey) + │ ├─TableReader(Build) 80007.93 root data:Selection + │ │ └─Selection 80007.93 cop[tikv] like(tpch.part.p_name, "green%", 92) + │ │ └─TableFullScan 10000000.00 cop[tikv] table:part keep order:false + │ └─IndexLookUp(Probe) 4.02 root + │ ├─IndexRangeScan(Build) 4.02 cop[tikv] table:partsupp, index:PRIMARY(PS_PARTKEY, PS_SUPPKEY) range: decided by [eq(tpch.partsupp.ps_partkey, tpch.part.p_partkey)], keep order:false + │ └─TableRowIDScan(Probe) 4.02 cop[tikv] table:partsupp keep order:false + └─TableReader(Probe) 44189356.65 root data:Selection + └─Selection 44189356.65 cop[tikv] ge(tpch.lineitem.l_shipdate, 1993-01-01 00:00:00.000000), lt(tpch.lineitem.l_shipdate, 1994-01-01) + └─TableFullScan 300005811.00 cop[tikv] table:lineitem keep order:false /* Q21 Suppliers Who Kept Orders Waiting Query This query identifies certain suppliers who were not able to ship required parts in a timely manner. @@ -1298,8 +1296,8 @@ cntrycode; id estRows task access object operator info Sort 1.00 root Column#27 └─Projection 1.00 root Column#27, Column#28, Column#29 - └─HashAgg 1.00 root group by:Column#27, funcs:count(1)->Column#28, funcs:sum(tpch.customer.c_acctbal)->Column#29, funcs:firstrow(Column#27)->Column#27 - └─Projection 0.00 root substring(tpch.customer.c_phone, 1, 2)->Column#27, tpch.customer.c_acctbal + └─HashAgg 1.00 root group by:Column#33, funcs:count(1)->Column#28, funcs:sum(Column#31)->Column#29, funcs:firstrow(Column#32)->Column#27 + └─Projection 0.00 root tpch.customer.c_acctbal, substring(tpch.customer.c_phone, 1, 2)->Column#32, substring(tpch.customer.c_phone, 1, 2)->Column#33 └─HashJoin 0.00 root anti semi join, equal:[eq(tpch.customer.c_custkey, tpch.orders.o_custkey)] ├─TableReader(Build) 75000000.00 root data:TableFullScan │ └─TableFullScan 75000000.00 cop[tikv] table:orders keep order:false diff --git a/ddl/table.go b/ddl/table.go index 263ad12fe460a..668de3ac41c05 100644 --- a/ddl/table.go +++ b/ddl/table.go @@ -33,6 +33,7 @@ import ( "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/meta/autoid" + "github.com/pingcap/tidb/store/tikv" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/tablecodec" @@ -328,7 +329,7 @@ func (w *worker) onRecoverTable(d *ddlCtx, t *meta.Meta, job *model.Job) (ver in failpoint.Inject("mockRecoverTableCommitErr", func(val failpoint.Value) { if val.(bool) && atomic.CompareAndSwapUint32(&mockRecoverTableCommitErrOnce, 0, 1) { - kv.MockCommitErrorEnable() + tikv.MockCommitErrorEnable() } }) diff --git a/executor/explainfor_test.go b/executor/explainfor_test.go index 6589144a60669..955b1605cf727 100644 --- a/executor/explainfor_test.go +++ b/executor/explainfor_test.go @@ -479,7 +479,4 @@ func (s *testPrepareSerialSuite) TestPointGetUserVarPlanCache(c *C) { tk.MustQuery("execute stmt using @a").Check(testkit.Rows( "2 4 2 2", )) - tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows( - "1", - )) } diff --git a/executor/prepared_test.go b/executor/prepared_test.go index 52e6157835424..4900a1c77df3a 100644 --- a/executor/prepared_test.go +++ b/executor/prepared_test.go @@ -254,7 +254,6 @@ func (s *testSerialSuite) TestPlanCacheClusterIndex(c *C) { tk.MustExec(`set @v1 = 'a', @v2 = 'b'`) tk.MustQuery(`execute stmt1 using @v1`).Check(testkit.Rows("a 1 a 1")) tk.MustQuery(`execute stmt1 using @v2`).Check(testkit.Rows("b 2 b 2")) - tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) // case 2: tk.MustExec(`drop table if exists ta, tb`) @@ -266,7 +265,6 @@ func (s *testSerialSuite) TestPlanCacheClusterIndex(c *C) { tk.MustExec(`set @v1 = 'a', @v2 = 'b'`) tk.MustQuery(`execute stmt1 using @v1`).Check(testkit.Rows("a 1 1 1")) tk.MustQuery(`execute stmt1 using @v2`).Check(testkit.Rows("b 2 2 2")) - tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) tk.MustQuery(`execute stmt1 using @v2`).Check(testkit.Rows("b 2 2 2")) tkProcess = tk.Se.ShowProcess() ps = []*util.ProcessInfo{tkProcess} diff --git a/executor/seqtest/prepared_test.go b/executor/seqtest/prepared_test.go index 32bf549751d1f..5583586dc8385 100644 --- a/executor/seqtest/prepared_test.go +++ b/executor/seqtest/prepared_test.go @@ -490,14 +490,14 @@ func (s *seqTestSuite) TestPreparedInsert(c *C) { err = counter.Write(pb) c.Assert(err, IsNil) hit := pb.GetCounter().GetValue() - c.Check(hit, Equals, float64(3)) + c.Check(hit, Equals, float64(2)) } tk.MustExec(`set @a=3; execute stmt_insert_select using @a;`) if flag { err = counter.Write(pb) c.Assert(err, IsNil) hit := pb.GetCounter().GetValue() - c.Check(hit, Equals, float64(4)) + c.Check(hit, Equals, float64(2)) } result = tk.MustQuery("select id, c1 from prepare_test where id = ?", 101) diff --git a/expression/util.go b/expression/util.go index d13f7f1e446e3..9819dbb447ac1 100644 --- a/expression/util.go +++ b/expression/util.go @@ -654,44 +654,6 @@ func PopRowFirstArg(ctx sessionctx.Context, e Expression) (ret Expression, err e return } -// exprStack is a stack of expressions. -type exprStack struct { - stack []Expression -} - -// pop pops an expression from the stack. -func (s *exprStack) pop() Expression { - if s.len() == 0 { - return nil - } - lastIdx := s.len() - 1 - expr := s.stack[lastIdx] - s.stack = s.stack[:lastIdx] - return expr -} - -// popN pops n expressions from the stack. -// If n greater than stack length or n is negative, it pops all the expressions. -func (s *exprStack) popN(n int) []Expression { - if n > s.len() || n < 0 { - n = s.len() - } - idx := s.len() - n - exprs := s.stack[idx:] - s.stack = s.stack[:idx] - return exprs -} - -// push pushes one expression to the stack. -func (s *exprStack) push(expr Expression) { - s.stack = append(s.stack, expr) -} - -// len returns the length of th stack. -func (s *exprStack) len() int { - return len(s.stack) -} - // DatumToConstant generates a Constant expression from a Datum. func DatumToConstant(d types.Datum, tp byte, flag uint) *Constant { t := types.NewFieldType(tp) diff --git a/go.mod b/go.mod index 0af92b79c3392..96a7691ba76d8 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,11 @@ module github.com/pingcap/tidb require ( github.com/BurntSushi/toml v0.3.1 + github.com/DATA-DOG/go-sqlmock v1.5.0 // indirect github.com/HdrHistogram/hdrhistogram-go v0.9.0 // indirect github.com/Jeffail/gabs/v2 v2.5.1 github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d + github.com/carlmjohnson/flagext v0.21.0 // indirect github.com/cheggaaa/pb/v3 v3.0.4 // indirect github.com/codahale/hdrhistogram v0.9.0 // indirect github.com/coocood/freecache v1.1.1 @@ -27,7 +29,7 @@ require ( github.com/gorilla/mux v1.7.4 github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 - github.com/klauspost/compress v1.10.5 // indirect + github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99 // indirect github.com/klauspost/cpuid v1.2.1 github.com/kr/text v0.2.0 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect @@ -40,7 +42,7 @@ require ( github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/pierrec/lz4 v2.5.2+incompatible // indirect github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19 - github.com/pingcap/br v4.0.0-beta.2.0.20210302095941-59e4efeaeb47+incompatible + github.com/pingcap/br v5.0.0-nightly.0.20210317100924-d95f9fdfcd29+incompatible github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712 github.com/pingcap/errors v0.11.5-0.20201126102027-b0a155152ca3 github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce @@ -65,6 +67,8 @@ require ( github.com/uber-go/atomic v1.4.0 github.com/uber/jaeger-client-go v2.22.1+incompatible github.com/uber/jaeger-lib v2.4.0+incompatible // indirect + github.com/xitongsys/parquet-go v1.6.0 // indirect + github.com/xitongsys/parquet-go-source v0.0.0-20201108113611-f372b7d813be // indirect github.com/zhangjinpeng1987/raft v0.0.0-20200819064223-df31bb68a018 // indirect go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b go.uber.org/atomic v1.7.0 @@ -84,6 +88,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect honnef.co/go/tools v0.1.3 // indirect + modernc.org/mathutil v1.2.2 // indirect sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 ) diff --git a/go.sum b/go.sum index b03be48dc4386..b113092f5d972 100644 --- a/go.sum +++ b/go.sum @@ -5,23 +5,44 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= +cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0 h1:9/vpR43S4aJaROxqQHQ3nH9lfyKKV0dC3vOmnw8ebQQ= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0 h1:RPUcBvDeYgQFMfQu1eBMq6piD1SXmLH+vK3qjewZPus= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= +github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/HdrHistogram/hdrhistogram-go v0.9.0 h1:dpujRju0R4M/QZzcnR1LH1qm+TVG3UzkWdp5tH1WMcg= github.com/HdrHistogram/hdrhistogram-go v0.9.0/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4= github.com/Jeffail/gabs/v2 v2.5.1 h1:ANfZYjpMlfTTKebycu4X1AgkVWumFVDYQl7JwOr4mDk= @@ -43,9 +64,13 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/apache/thrift v0.0.0-20181112125854-24918abba929/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.1-0.20201008052519-daf620915714 h1:Jz3KVLYY5+JO7rDiX0sAuRGtuv2vG01r17Y9nLMWNUw= +github.com/apache/thrift v0.13.1-0.20201008052519-daf620915714/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/appleboy/gin-jwt/v2 v2.6.3/go.mod h1:MfPYA4ogzvOcVkRwAxT7quHOtQmVKDpTwxyUrC2DNw0= github.com/appleboy/gofight/v2 v2.1.2/go.mod h1:frW+U1QZEdDgixycTj4CygQ48yLTUhplt43+Wczp3rw= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aws/aws-sdk-go v1.30.19/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.35.3 h1:r0puXncSaAfRt7Btml2swUo74Kao+vKhO3VLjwDjK54= github.com/aws/aws-sdk-go v1.35.3/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -57,6 +82,8 @@ github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d h1:rQ github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d/go.mod h1:VKt7CNAQxpFpSDz3sXyj9hY/GbVsQCr0sB3w59nE7lU= github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 h1:BjkPE3785EwPhhyuFkbINB+2a1xATwk8SNDWnJiD41g= github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5/go.mod h1:jtAfVaU/2cu1+wdSRPWE2c1N2qeAA3K4RH9pYgqwets= +github.com/carlmjohnson/flagext v0.21.0 h1:/c4uK3ie786Z7caXLcIMvePNSSiH3bQVGDvmGLMme60= +github.com/carlmjohnson/flagext v0.21.0/go.mod h1:Eenv0epIUAr4NuedNmkzI8WmBmjIxZC239XcKxYS2ac= github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -74,6 +101,7 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.9.0 h1:9GjrtRI+mLEFPtTfR/AZhcxp+Ii8NZYWq5104FbZQY0= github.com/codahale/hdrhistogram v0.9.0/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/colinmarc/hdfs/v2 v2.1.1/go.mod h1:M3x+k8UKKmxtFu++uAZ0OtDU8jR3jnaZIAc6yK4Ue0c= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64 h1:W1SHiII3e0jVwvaQFglwu3kS9NLxOeTpvik7MbKCyuQ= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64/go.mod h1:F86k/6c7aDUdwSUevnLpHS/3Q9hzYCE99jGk2xsHnt0= github.com/coocood/freecache v1.1.1 h1:uukNF7QKCZEdZ9gAV7WQzvh0SbjwdMF6m3x3rxEkaPc= @@ -154,6 +182,7 @@ github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-echarts/go-echarts v1.0.0/go.mod h1:qbmyAb/Rl1f2w7wKba1D4LoNq4U164yO4/wedFbcWyo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -197,18 +226,24 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v0.0.0-20180814211427-aa810b61a9c7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf h1:gFVkHXmVAhEbxZVDln5V9GKrLaluNoFHDbrZwAWZgws= github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -226,6 +261,8 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200407044318-7d83b28da2e9 h1:K+lX49/3eURCE1IjlaZN//u6c+9nfDAMnyQ9E2dsJbY= github.com/google/pprof v0.0.0-20200407044318-7d83b28da2e9/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -255,6 +292,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69/go.mod h1:YLEMZOtU+AZ7dhN9T/IpGhXVGly2bvkJQ+zxj3WeVQo= +github.com/hashicorp/go-uuid v0.0.0-20180228145832-27454136f036/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -266,15 +304,19 @@ github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73t github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jcmturner/gofork v0.0.0-20180107083740-2aebee971930/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/gorm v1.9.12/go.mod h1:vhTjlKSJUTWNtcbQtrMBFCxy7eXTzeCAzfL5fBZT/Qs= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99 h1:yYV8KMzsc4ius4P8A9BK13cY6nFDL3jlVX25HvEXOkw= +github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99/go.mod h1:mAVCUAYtW9NG31eB30umMSLKcDt6mCUWSjoSn5qBh0k= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joomcode/errorx v1.0.1/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ= @@ -294,6 +336,7 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.5 h1:7q6vHIqubShURwQz8cQK6yIe/xC3IF0Vm7TGfqjewrc= github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w= @@ -321,6 +364,8 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -352,6 +397,7 @@ github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFW github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/ncw/directio v1.0.4 h1:CojwI07mCEmRkajgx42Pf8jyCwTs1ji9/Ij9/PJG12k= github.com/ncw/directio v1.0.4/go.mod h1:CKGdcN7StAaqjT7Qack3lAXeX4pjnyc46YeqZH1yWVY= +github.com/ncw/swift v1.0.52/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 h1:7KAv7KMGTTqSmYZtNdcNTgsos+vFzULLwyElndwn+5c= github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7/go.mod h1:iWMfgwqYW+e8n5lC/jjNEhwcjbRDpl5NT7n2h+4UNcI= @@ -375,6 +421,7 @@ github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7l github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pborman/getopt v0.0.0-20180729010549-6fdd0a2c7117/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.3.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= @@ -386,8 +433,8 @@ github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUM github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19 h1:IXpGy7y9HyoShAFmzW2OPF0xCA5EOoSTyZHwsgYk9Ro= github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19/go.mod h1:LyrqUOHZrUDf9oGi1yoz1+qw9ckSIhQb5eMa1acOLNQ= -github.com/pingcap/br v4.0.0-beta.2.0.20210302095941-59e4efeaeb47+incompatible h1:0B1CQlmaky9VEa1STBH/WM81wLOuFJ2Rmb5APHzPefU= -github.com/pingcap/br v4.0.0-beta.2.0.20210302095941-59e4efeaeb47+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ= +github.com/pingcap/br v5.0.0-nightly.0.20210317100924-d95f9fdfcd29+incompatible h1:K3DXUdxw67vH8nehT2yYavJIgYbNxl3hw0zZIkQdoyw= +github.com/pingcap/br v5.0.0-nightly.0.20210317100924-d95f9fdfcd29+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ= github.com/pingcap/check v0.0.0-20191107115940-caf2b9e6ccf4/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= github.com/pingcap/check v0.0.0-20191216031241-8a5a85928f12/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= @@ -460,8 +507,9 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBmr8YXawX/le3+O26N+vPPC1PtjaF3mwnook= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -493,6 +541,7 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -558,6 +607,13 @@ github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oT github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xitongsys/parquet-go v1.5.1/go.mod h1:xUxwM8ELydxh4edHGegYq1pA8NnMKDx0K/GyB0o2bww= +github.com/xitongsys/parquet-go v1.6.0 h1:j6YrTVZdQx5yywJLIOklZcKVsCoSD1tqOVRXyTBFSjs= +github.com/xitongsys/parquet-go v1.6.0/go.mod h1:pheqtXeHQFzxJk45lRQ0UIGIivKnLXvialZSFWs81A8= +github.com/xitongsys/parquet-go-source v0.0.0-20190524061010-2b72cbee77d5/go.mod h1:xxCx7Wpym/3QCo6JhujJX51dzSXrwmb0oH6FQb39SEA= +github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0/go.mod h1:HYhIKsdns7xz80OgkbgJYrtQY7FjHWHKH6cvN7+czGE= +github.com/xitongsys/parquet-go-source v0.0.0-20201108113611-f372b7d813be h1:33jqDHcXK6vfgtLossgwZmTXyLCdPZU3/KZ3988bk3Q= +github.com/xitongsys/parquet-go-source v0.0.0-20201108113611-f372b7d813be/go.mod h1:SQSSW1CBj/egoUhnaTXihUlDayvpp01Fn8qwuEpK5bY= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yookoala/realpath v1.0.0/go.mod h1:gJJMA9wuX7AcqLy1+ffPatSCySA1FQ2S8Ya9AIoYBpE= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -573,8 +629,9 @@ go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b h1:3kC4J3eQF6p1UEfQ go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -601,6 +658,7 @@ go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -610,6 +668,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= @@ -620,8 +679,11 @@ golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxT golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299 h1:zQpM52jfKHG6II1ISZY1ZcpygvuSFZpLwfluuF89XOg= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -632,13 +694,15 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= @@ -664,8 +728,11 @@ golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -676,8 +743,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -708,14 +776,19 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -724,6 +797,7 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -732,8 +806,9 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -763,8 +838,16 @@ golang.org/x/tools v0.0.0-20191114200427-caa0b0f7d508/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200225230052-807dcd883420/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200527183253-8e7acdbce89d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -783,8 +866,10 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0 h1:TgDr+1inK2XVUKZx3BYAqQg/GwucGdBkzZjWaTg/I+A= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -804,8 +889,13 @@ google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -816,6 +906,7 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/gometalinter.v2 v2.0.12/go.mod h1:NDRytsqEZyolNuAgTzJkZMkSQM7FIKyzVzGhjB/qfYo= @@ -833,6 +924,11 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= +gopkg.in/jcmturner/gokrb5.v7 v7.3.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -856,10 +952,15 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 h1:ucqkfpjg9WzSUubAO62csmucvxl4/JeW3F4I4909XkM= diff --git a/kv/txn.go b/kv/txn.go index 00dad8a7d3b19..c5c21b8348263 100644 --- a/kv/txn.go +++ b/kv/txn.go @@ -17,7 +17,6 @@ import ( "context" "math" "math/rand" - "sync/atomic" "time" "github.com/pingcap/parser/terror" @@ -94,24 +93,6 @@ func BackOff(attempts uint) int { return int(sleep) } -// mockCommitErrorEnable uses to enable `mockCommitError` and only mock error once. -var mockCommitErrorEnable = int64(0) - -// MockCommitErrorEnable exports for gofail testing. -func MockCommitErrorEnable() { - atomic.StoreInt64(&mockCommitErrorEnable, 1) -} - -// MockCommitErrorDisable exports for gofail testing. -func MockCommitErrorDisable() { - atomic.StoreInt64(&mockCommitErrorEnable, 0) -} - -// IsMockCommitErrorEnable exports for gofail testing. -func IsMockCommitErrorEnable() bool { - return atomic.LoadInt64(&mockCommitErrorEnable) == 1 -} - // TxnInfo is used to keep track the info of a committed transaction (mainly for diagnosis and testing) type TxnInfo struct { TxnScope string `json:"txn_scope"` diff --git a/kv/txn_test.go b/kv/txn_test.go index 38e85ad354bfd..475a956ffdb36 100644 --- a/kv/txn_test.go +++ b/kv/txn_test.go @@ -77,16 +77,3 @@ func (s *testTxnSuite) TestRetryExceedCountError(c *C) { }) c.Assert(err, NotNil) } - -func (s *testTxnSuite) TestBasicFunc(c *C) { - if IsMockCommitErrorEnable() { - defer MockCommitErrorEnable() - } else { - defer MockCommitErrorDisable() - } - - MockCommitErrorEnable() - c.Assert(IsMockCommitErrorEnable(), IsTrue) - MockCommitErrorDisable() - c.Assert(IsMockCommitErrorEnable(), IsFalse) -} diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 0fa0840a44f95..ffb42db8d87b2 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -425,6 +425,9 @@ REBUILD: // short paths for these executions, currently "point select" and "point update" func (e *Execute) tryCachePointPlan(ctx context.Context, sctx sessionctx.Context, preparedStmt *CachedPrepareStmt, is infoschema.InfoSchema, p Plan) error { + if sctx.GetSessionVars().StmtCtx.OptimDependOnMutableConst { + return nil + } var ( prepared = preparedStmt.PreparedAst ok bool diff --git a/planner/core/find_best_task.go b/planner/core/find_best_task.go index 4c4d18a15ea2b..f6c07ce9da0b6 100644 --- a/planner/core/find_best_task.go +++ b/planner/core/find_best_task.go @@ -528,7 +528,7 @@ func (ds *DataSource) skylinePruning(prop *property.PhysicalProperty) []*candida continue } // if we already know the range of the scan is empty, just return a TableDual - if len(path.Ranges) == 0 && !ds.ctx.GetSessionVars().StmtCtx.UseCache { + if len(path.Ranges) == 0 { return []*candidatePath{{path: path}} } if path.StoreType != kv.TiFlash && (prop.TaskTp == property.CopTiFlashLocalReadTaskType || prop.TaskTp == property.CopTiFlashGlobalReadTaskType) { diff --git a/planner/core/prepare_test.go b/planner/core/prepare_test.go index db2d4d619396c..446f4913686f4 100644 --- a/planner/core/prepare_test.go +++ b/planner/core/prepare_test.go @@ -1036,3 +1036,96 @@ func (s *testPlanSerialSuite) TestPlanCacheSnapshot(c *C) { tk.MustQuery("execute stmt using @p").Check(testkit.Rows("1")) tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("1")) } + +func (s *testPlanSerialSuite) TestPlanCachePointGetAndTableDual(c *C) { + store, _, err := newStoreWithBootstrap() + c.Assert(err, IsNil) + tk := testkit.NewTestKit(c, store) + orgEnable := core.PreparedPlanCacheEnabled() + defer func() { + store.Close() + core.SetPreparedPlanCache(orgEnable) + }() + core.SetPreparedPlanCache(true) + + tk.Se, err = session.CreateSession4TestWithOpt(store, &session.Opt{ + PreparedPlanCache: kvcache.NewSimpleLRUCache(100, 0.1, math.MaxUint64), + }) + c.Assert(err, IsNil) + + tk.MustExec("use test") + tk.MustExec("drop table if exists t0, t1, t2, t3, t4") + + tk.MustExec("create table t0(c1 varchar(20), c2 varchar(20), c3 bigint(20), primary key(c1, c2))") + tk.MustExec("insert into t0 values('0000','7777',1)") + tk.MustExec("prepare s0 from 'select * from t0 where c1=? and c2>=? and c2<=?'") + tk.MustExec("set @a0='0000', @b0='9999'") + // TableDual plan would be built, we should not cache it. + tk.MustQuery("execute s0 using @a0, @b0, @a0").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous TableDual plan. + tk.MustQuery("execute s0 using @a0, @a0, @b0").Check(testkit.Rows("0000 7777 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("create table t1(c1 varchar(20), c2 varchar(20), c3 bigint(20), primary key(c1, c2))") + tk.MustExec("insert into t1 values('0000','7777',1)") + tk.MustExec("prepare s1 from 'select * from t1 where c1=? and c2>=? and c2<=?'") + tk.MustExec("set @a1='0000', @b1='9999'") + // PointGet plan would be built, we should not cache it. + tk.MustQuery("execute s1 using @a1, @b1, @b1").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous PointGet plan. + tk.MustQuery("execute s1 using @a1, @a1, @b1").Check(testkit.Rows("0000 7777 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("create table t2(c1 bigint(20) primary key, c2 varchar(20))") + tk.MustExec("insert into t2 values(1,'7777')") + tk.MustExec("prepare s2 from 'select * from t2 where c1>=? and c1<=?'") + tk.MustExec("set @a2=0, @b2=9") + // PointGet plan would be built, we should not cache it. + tk.MustQuery("execute s2 using @a2, @a2").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous PointGet plan. + tk.MustQuery("execute s2 using @a2, @b2").Check(testkit.Rows("1 7777")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("create table t3(c1 int, c2 int, c3 int, unique key(c1), key(c2))") + tk.MustExec("insert into t3 values(2,1,1)") + tk.MustExec("prepare s3 from 'select /*+ use_index_merge(t3) */ * from t3 where (c1 >= ? and c1 <= ?) or c2 > 1'") + tk.MustExec("set @a3=1,@b3=3") + // PointGet partial plan would be built, we should not cache it. + tk.MustQuery("execute s3 using @a3,@a3").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous IndexMerge with partial PointGet plan. + tk.MustQuery("execute s3 using @a3,@b3").Check(testkit.Rows("2 1 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("prepare s3 from 'select /*+ use_index_merge(t3) */ * from t3 where (c1 >= ? and c1 <= ?) or c2 > 1'") + tk.MustExec("set @a3=1,@b3=3") + // TableDual partial plan would be built, we should not cache it. + tk.MustQuery("execute s3 using @b3,@a3").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous IndexMerge with partial TableDual plan. + tk.MustQuery("execute s3 using @a3,@b3").Check(testkit.Rows("2 1 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("create table t4(c1 int primary key, c2 int, c3 int, key(c2))") + tk.MustExec("insert into t4 values(2,1,1)") + tk.MustExec("prepare s4 from 'select /*+ use_index_merge(t4) */ * from t4 where (c1 >= ? and c1 <= ?) or c2 > 1'") + tk.MustExec("set @a4=1,@b4=3") + // PointGet partial plan would be built, we should not cache it. + tk.MustQuery("execute s4 using @a4,@a4").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous IndexMerge with partial PointGet plan. + tk.MustQuery("execute s4 using @a4,@b4").Check(testkit.Rows("2 1 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + + tk.MustExec("prepare s4 from 'select /*+ use_index_merge(t4) */ * from t4 where (c1 >= ? and c1 <= ?) or c2 > 1'") + tk.MustExec("set @a4=1,@b4=3") + // TableDual partial plan would be built, we should not cache it. + tk.MustQuery("execute s4 using @b4,@a4").Check(testkit.Rows()) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) + // Must not reuse the previous IndexMerge with partial TableDual plan. + tk.MustQuery("execute s4 using @a4,@b4").Check(testkit.Rows("2 1 1")) + tk.MustQuery("select @@last_plan_from_cache").Check(testkit.Rows("0")) +} diff --git a/planner/core/rule_aggregation_push_down.go b/planner/core/rule_aggregation_push_down.go index 800915e345448..b3dd0e4b95295 100644 --- a/planner/core/rule_aggregation_push_down.go +++ b/planner/core/rule_aggregation_push_down.go @@ -424,7 +424,7 @@ func (a *aggregationPushDownSolver) aggPushDown(p LogicalPlan) (_ LogicalPlan, e p = proj } } - } else if proj, ok1 := child.(*LogicalProjection); ok1 && p.SCtx().GetSessionVars().AllowAggPushDown { + } else if proj, ok1 := child.(*LogicalProjection); ok1 { // TODO: This optimization is not always reasonable. We have not supported pushing projection to kv layer yet, // so we must do this optimization. for i, gbyItem := range agg.GroupByItems { diff --git a/planner/core/stats.go b/planner/core/stats.go index b9c3f7563a47a..2e2d62fe9b714 100644 --- a/planner/core/stats.go +++ b/planner/core/stats.go @@ -285,6 +285,7 @@ func (ds *DataSource) DeriveStats(childStats []*property.StatsInfo, selfSchema * if noIntervalRanges || len(path.Ranges) == 0 { ds.possibleAccessPaths[0] = path ds.possibleAccessPaths = ds.possibleAccessPaths[:1] + ds.ctx.GetSessionVars().StmtCtx.OptimDependOnMutableConst = true break } continue @@ -294,6 +295,7 @@ func (ds *DataSource) DeriveStats(childStats []*property.StatsInfo, selfSchema * if (noIntervalRanges && path.Index.Unique) || len(path.Ranges) == 0 { ds.possibleAccessPaths[0] = path ds.possibleAccessPaths = ds.possibleAccessPaths[:1] + ds.ctx.GetSessionVars().StmtCtx.OptimDependOnMutableConst = true break } } @@ -506,10 +508,8 @@ func (ds *DataSource) accessPathsForConds(conditions []expression.Expression, us logutil.BgLogger().Debug("can not derive statistics of a path", zap.Error(err)) continue } - // If `AccessConds` is empty, we ignore the access path. - // If the path contains a full range, ignore it also. This can happen when `AccessConds` is constant true, and - // it comes from the result of a subquery, so it is not folded. - if len(path.AccessConds) == 0 || ranger.HasFullRange(path.Ranges) { + // If the path contains a full range, ignore it. + if ranger.HasFullRange(path.Ranges) { continue } // If we have point or empty range, just remove other possible paths. @@ -520,6 +520,7 @@ func (ds *DataSource) accessPathsForConds(conditions []expression.Expression, us results[0] = path results = results[:1] } + ds.ctx.GetSessionVars().StmtCtx.OptimDependOnMutableConst = true break } } else { @@ -533,10 +534,8 @@ func (ds *DataSource) accessPathsForConds(conditions []expression.Expression, us continue } noIntervalRanges := ds.deriveIndexPathStats(path, conditions, true) - // If `AccessConds` is empty, we ignore the access path. - // If the path contains a full range, ignore it also. This can happen when `AccessConds` is constant true, and - // it comes from the result of a subquery, so it is not folded. - if len(path.AccessConds) == 0 || ranger.HasFullRange(path.Ranges) { + // If the path contains a full range, ignore it. + if ranger.HasFullRange(path.Ranges) { continue } // If we have empty range, or point range on unique index, just remove other possible paths. @@ -547,6 +546,7 @@ func (ds *DataSource) accessPathsForConds(conditions []expression.Expression, us results[0] = path results = results[:1] } + ds.ctx.GetSessionVars().StmtCtx.OptimDependOnMutableConst = true break } } diff --git a/planner/core/testdata/integration_serial_suite_out.json b/planner/core/testdata/integration_serial_suite_out.json index 09df62e2b7d27..736bcf4da5dfd 100644 --- a/planner/core/testdata/integration_serial_suite_out.json +++ b/planner/core/testdata/integration_serial_suite_out.json @@ -1204,9 +1204,8 @@ "Plan": [ "HashAgg 1.00 root funcs:count(Column#7)->Column#5", "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:count(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1223,18 +1222,17 @@ "Plan": [ "HashAgg 1.00 root funcs:sum(Column#7)->Column#5", "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "StreamAgg 1.00 root funcs:count(Column#4)->Column#5", - "└─Projection 10000.00 root plus(test.t.id, 1)->Column#4", - " └─TableReader 10000.00 root data:TableFullScan", - " └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1250,10 +1248,9 @@ "SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ "StreamAgg 1.00 root funcs:sum(Column#7)->Column#5", - "└─Projection 10000.00 root cast(Column#4, decimal(41,0) BINARY)->Column#7", - " └─Projection 10000.00 root plus(test.t.id, 1)->Column#4", - " └─TableReader 10000.00 root data:TableFullScan", - " └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo" + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1345,12 +1342,11 @@ { "SQL": "desc format = 'brief' select /*+ hash_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#7)->Column#5", + "HashAgg 1.00 root funcs:count(Column#8)->Column#5", "└─TableReader 1.00 root data:ExchangeSender", " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:count(plus(test.t.id, 1))->Column#8", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1366,21 +1362,20 @@ { "SQL": "desc format = 'brief' select /*+ hash_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#7)->Column#5", + "HashAgg 1.00 root funcs:sum(Column#8)->Column#5", "└─TableReader 1.00 root data:ExchangeSender", " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(plus(test.t.id, 1))->Column#8", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "StreamAgg 1.00 root funcs:count(Column#4)->Column#5", - "└─Projection 10000.00 root plus(test.t.id, 1)->Column#4", - " └─TableReader 10000.00 root data:TableFullScan", - " └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1396,10 +1391,9 @@ "SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ "StreamAgg 1.00 root funcs:sum(Column#7)->Column#5", - "└─Projection 10000.00 root cast(Column#4, decimal(41,0) BINARY)->Column#7", - " └─Projection 10000.00 root plus(test.t.id, 1)->Column#4", - " └─TableReader 10000.00 root data:TableFullScan", - " └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo" + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(plus(test.t.id, 1))->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1512,12 +1506,11 @@ { "SQL": "desc format = 'brief' select /*+ hash_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#7)->Column#5", + "HashAgg 1.00 root funcs:count(Column#8)->Column#5", "└─TableReader 1.00 root data:ExchangeSender", " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:count(plus(test.t.id, 1))->Column#8", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -1533,12 +1526,11 @@ { "SQL": "desc format = 'brief' select /*+ hash_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#7)->Column#5", + "HashAgg 1.00 root funcs:sum(Column#8)->Column#5", "└─TableReader 1.00 root data:ExchangeSender", " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#4)->Column#7", - " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4", - " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" + " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(plus(test.t.id, 1))->Column#8", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { diff --git a/planner/core/testdata/plan_suite_out.json b/planner/core/testdata/plan_suite_out.json index 161ed9bb69001..2677b074a7ee7 100644 --- a/planner/core/testdata/plan_suite_out.json +++ b/planner/core/testdata/plan_suite_out.json @@ -1854,13 +1854,16 @@ { "SQL": "select distinct DATE_FORMAT(timestamp, '%Y-%m-%d %H') as tt from tc ;", "Plan": [ - "HashAgg 16000.00 root group by:Column#3, funcs:firstrow(Column#3)->Column#3", - "└─Projection 20000.00 root date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#3", - " └─PartitionUnion 20000.00 root ", - " ├─TableReader 10000.00 root data:TableFullScan", - " │ └─TableFullScan 10000.00 cop[tikv] table:tc, partition:p2020072312 keep order:false, stats:pseudo", - " └─TableReader 10000.00 root data:TableFullScan", - " └─TableFullScan 10000.00 cop[tikv] table:tc, partition:p2020072313 keep order:false, stats:pseudo" + "HashAgg 16000.00 root group by:Column#5, funcs:firstrow(Column#6)->Column#3", + "└─PartitionUnion 16000.00 root ", + " ├─HashAgg 8000.00 root group by:Column#15, funcs:firstrow(Column#13)->Column#6, funcs:firstrow(Column#14)->Column#5", + " │ └─Projection 10000.00 root date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#13, date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#14, date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#15", + " │ └─TableReader 10000.00 root data:TableFullScan", + " │ └─TableFullScan 10000.00 cop[tikv] table:tc, partition:p2020072312 keep order:false, stats:pseudo", + " └─HashAgg 8000.00 root group by:Column#18, funcs:firstrow(Column#16)->Column#6, funcs:firstrow(Column#17)->Column#5", + " └─Projection 10000.00 root date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#16, date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#17, date_format(test.tc.timestamp, %Y-%m-%d %H)->Column#18", + " └─TableReader 10000.00 root data:TableFullScan", + " └─TableFullScan 10000.00 cop[tikv] table:tc, partition:p2020072313 keep order:false, stats:pseudo" ], "Result": null } diff --git a/planner/core/testdata/plan_suite_unexported_out.json b/planner/core/testdata/plan_suite_unexported_out.json index a14246ddc1982..fb45c07f644e6 100644 --- a/planner/core/testdata/plan_suite_unexported_out.json +++ b/planner/core/testdata/plan_suite_unexported_out.json @@ -51,7 +51,7 @@ "Join{DataScan(t1)->DataScan(t2)}->Projection", "Join{DataScan(t1)->DataScan(t2)}->Projection", "LeftHashJoin{LeftHashJoin{TableReader(Table(t))->IndexLookUp(Index(t.c_d_e)[[666,666]], Table(t))}(test.t.a,test.t.b)->IndexReader(Index(t.c_d_e)[[42,42]])}(test.t.b,test.t.a)->Sel([or(Column#25, Column#38)])->Projection->Delete", - "LeftHashJoin{TableReader(Table(t))->IndexReader(Index(t.c_d_e)[[NULL,+inf]])->HashAgg}(test.t.b,test.t.c)->Update" + "LeftHashJoin{TableReader(Table(t))->IndexReader(Index(t.c_d_e)[[NULL,+inf]]->HashAgg)->HashAgg}(test.t.b,test.t.c)->Update" ] }, { diff --git a/planner/core/testdata/stats_suite_out.json b/planner/core/testdata/stats_suite_out.json index e284758839d89..ff1abdaac8e95 100644 --- a/planner/core/testdata/stats_suite_out.json +++ b/planner/core/testdata/stats_suite_out.json @@ -170,8 +170,8 @@ { "SQL": "select count(c3) from (select a as c1, b as c2, a+1 as c3 from t1) as tmp group by c2, c1", "Plan": [ - "StreamAgg 4.00 root group by:test.t1.a, test.t1.b, funcs:count(Column#4)->Column#5", - "└─Projection 4.00 root test.t1.a, test.t1.b, plus(test.t1.a, 1)->Column#4", + "StreamAgg 4.00 root group by:Column#10, Column#11, funcs:count(Column#9)->Column#5", + "└─Projection 4.00 root plus(test.t1.a, 1)->Column#9, test.t1.b, test.t1.a", " └─IndexReader 4.00 root index:IndexFullScan", " └─IndexFullScan 4.00 cop[tikv] table:t1, index:a(a, b) keep order:true" ] @@ -179,8 +179,8 @@ { "SQL": "select count(tmp.cmp) from (select t1.a as a, t1.b as b, (t1.b > (select t2.b from t2 where t2.a = t1.a)) as cmp from t1) tmp group by tmp.a, tmp.b", "Plan": [ - "StreamAgg 4.00 root group by:test.t1.a, test.t1.b, funcs:count(Column#7)->Column#8", - "└─Projection 4.00 root test.t1.a, test.t1.b, gt(test.t1.b, test.t2.b)->Column#7", + "StreamAgg 4.00 root group by:Column#11, Column#12, funcs:count(Column#10)->Column#8", + "└─Projection 4.00 root gt(test.t1.b, test.t2.b)->Column#10, test.t1.a, test.t1.b", " └─Apply 4.00 root CARTESIAN left outer join", " ├─IndexReader(Build) 4.00 root index:IndexFullScan", " │ └─IndexFullScan 4.00 cop[tikv] table:t1, index:a(a, b) keep order:true", diff --git a/session/session.go b/session/session.go index 4763407ca5886..e37d3bcbac962 100644 --- a/session/session.go +++ b/session/session.go @@ -453,8 +453,8 @@ func (s *session) doCommit(ctx context.Context) error { // mockCommitError and mockGetTSErrorInRetry use to test PR #8743. failpoint.Inject("mockCommitError", func(val failpoint.Value) { - if val.(bool) && kv.IsMockCommitErrorEnable() { - kv.MockCommitErrorDisable() + if val.(bool) && tikv.IsMockCommitErrorEnable() { + tikv.MockCommitErrorDisable() failpoint.Return(kv.ErrTxnRetryable) } }) diff --git a/sessionctx/binloginfo/binloginfo_test.go b/sessionctx/binloginfo/binloginfo_test.go index a64d2684aec26..a6bb7a758a5e7 100644 --- a/sessionctx/binloginfo/binloginfo_test.go +++ b/sessionctx/binloginfo/binloginfo_test.go @@ -15,6 +15,7 @@ package binloginfo_test import ( "context" + "fmt" "net" "os" "strconv" @@ -50,7 +51,10 @@ import ( func TestT(t *testing.T) { CustomVerboseFlag = true logLevel := os.Getenv("log_level") - logutil.InitLogger(logutil.NewLogConfig(logLevel, logutil.DefaultLogFormat, "", logutil.EmptyFileLogConfig, false)) + err := logutil.InitLogger(logutil.NewLogConfig(logLevel, logutil.DefaultLogFormat, "", logutil.EmptyFileLogConfig, false)) + if err != nil { + t.Fatal(err) + } TestingT(t) } @@ -103,7 +107,10 @@ func (s *testBinlogSuite) SetUpSuite(c *C) { s.serv = grpc.NewServer(grpc.MaxRecvMsgSize(maxRecvMsgSize)) s.pump = new(mockBinlogPump) binlog.RegisterPumpServer(s.serv, s.pump) - go s.serv.Serve(l) + go func() { + err := s.serv.Serve(l) + c.Assert(err, IsNil) + }() opt := grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout("unix", addr, timeout) }) @@ -122,11 +129,16 @@ func (s *testBinlogSuite) SetUpSuite(c *C) { } func (s *testBinlogSuite) TearDownSuite(c *C) { - s.ddl.Stop() + err := s.ddl.Stop() + c.Assert(err, IsNil) s.serv.Stop() - os.Remove(s.unixFile) + err = os.Remove(s.unixFile) + if err != nil { + c.Assert(err, ErrorMatches, fmt.Sprintf("remove %v: no such file or directory", s.unixFile)) + } s.domain.Close() - s.store.Close() + err = s.store.Close() + c.Assert(err, IsNil) } func (s *testBinlogSuite) TestBinlog(c *C) { @@ -307,7 +319,8 @@ func getLatestBinlogPrewriteValue(c *C, pump *mockBinlogPump) *binlog.PrewriteVa for i := len(pump.mu.payloads) - 1; i >= 0; i-- { payload := pump.mu.payloads[i] bin = new(binlog.Binlog) - bin.Unmarshal(payload) + err := bin.Unmarshal(payload) + c.Assert(err, IsNil) if bin.Tp == binlog.BinlogType_Prewrite { break } @@ -315,7 +328,8 @@ func getLatestBinlogPrewriteValue(c *C, pump *mockBinlogPump) *binlog.PrewriteVa pump.mu.Unlock() c.Assert(bin, NotNil) preVal := new(binlog.PrewriteValue) - preVal.Unmarshal(bin.PrewriteValue) + err := preVal.Unmarshal(bin.PrewriteValue) + c.Assert(err, IsNil) return preVal } @@ -324,7 +338,8 @@ func getLatestDDLBinlog(c *C, pump *mockBinlogPump, ddlQuery string) (preDDL, co for i := len(pump.mu.payloads) - 1; i >= 0; i-- { payload := pump.mu.payloads[i] bin := new(binlog.Binlog) - bin.Unmarshal(payload) + err := bin.Unmarshal(payload) + c.Assert(err, IsNil) if bin.Tp == binlog.BinlogType_Commit && bin.DdlJobId > 0 { commitDDL = bin } @@ -353,7 +368,8 @@ func checkBinlogCount(c *C, pump *mockBinlogPump) { for i := length - 1; i >= 0; i-- { payload := pump.mu.payloads[i] bin = new(binlog.Binlog) - bin.Unmarshal(payload) + err := bin.Unmarshal(payload) + c.Assert(err, IsNil) if bin.Tp == binlog.BinlogType_Prewrite { if bin.DdlJobId != 0 { ddlCount++ diff --git a/sessionctx/variable/varsutil_test.go b/sessionctx/variable/varsutil_test.go index b5ad1c5b20486..3668e16db1c72 100644 --- a/sessionctx/variable/varsutil_test.go +++ b/sessionctx/variable/varsutil_test.go @@ -149,7 +149,8 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(err, IsNil) c.Assert(val, Equals, "STRICT_TRANS_TABLES") c.Assert(v.StrictSQLMode, IsTrue) - SetSessionSystemVar(v, "sql_mode", types.NewStringDatum("")) + err = SetSessionSystemVar(v, "sql_mode", types.NewStringDatum("")) + c.Assert(err, IsNil) c.Assert(v.StrictSQLMode, IsFalse) err = SetSessionSystemVar(v, "character_set_connection", types.NewStringDatum("utf8")) @@ -191,7 +192,8 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(err, IsNil) c.Assert(v.TimeZone.String(), Equals, tt.expect) if tt.compareValue { - SetSessionSystemVar(v, TimeZone, types.NewStringDatum(tt.input)) + err = SetSessionSystemVar(v, TimeZone, types.NewStringDatum(tt.input)) + c.Assert(err, IsNil) t1 := time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) t2 := time.Date(2000, 1, 1, 0, 0, 0, 0, v.TimeZone) c.Assert(t2.Sub(t1), Equals, tt.diff) @@ -203,7 +205,8 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { // Test case for sql mode. for str, mode := range mysql.Str2SQLMode { - SetSessionSystemVar(v, "sql_mode", types.NewStringDatum(str)) + err = SetSessionSystemVar(v, "sql_mode", types.NewStringDatum(str)) + c.Assert(err, IsNil) if modeParts, exists := mysql.CombinationSQLMode[str]; exists { for _, part := range modeParts { mode |= mysql.Str2SQLMode[part] @@ -224,17 +227,20 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(terror.ErrorEqual(err, ErrWrongValueForVar), IsTrue) // Combined sql_mode - SetSessionSystemVar(v, "sql_mode", types.NewStringDatum("REAL_AS_FLOAT,ANSI_QUOTES")) + err = SetSessionSystemVar(v, "sql_mode", types.NewStringDatum("REAL_AS_FLOAT,ANSI_QUOTES")) + c.Assert(err, IsNil) c.Assert(v.SQLMode, Equals, mysql.ModeRealAsFloat|mysql.ModeANSIQuotes) // Test case for tidb_index_serial_scan_concurrency. c.Assert(v.IndexSerialScanConcurrency(), Equals, DefIndexSerialScanConcurrency) - SetSessionSystemVar(v, TiDBIndexSerialScanConcurrency, types.NewStringDatum("4")) + err = SetSessionSystemVar(v, TiDBIndexSerialScanConcurrency, types.NewStringDatum("4")) + c.Assert(err, IsNil) c.Assert(v.IndexSerialScanConcurrency(), Equals, 4) // Test case for tidb_batch_insert. c.Assert(v.BatchInsert, IsFalse) - SetSessionSystemVar(v, TiDBBatchInsert, types.NewStringDatum("1")) + err = SetSessionSystemVar(v, TiDBBatchInsert, types.NewStringDatum("1")) + c.Assert(err, IsNil) c.Assert(v.BatchInsert, IsTrue) c.Assert(v.InitChunkSize, Equals, 32) @@ -253,25 +259,29 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(err, IsNil) c.Assert(val, Equals, string(bVal)) - SetSessionSystemVar(v, TiDBEnableStreaming, types.NewStringDatum("1")) + err = SetSessionSystemVar(v, TiDBEnableStreaming, types.NewStringDatum("1")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBEnableStreaming) c.Assert(err, IsNil) c.Assert(val, Equals, "ON") c.Assert(v.EnableStreaming, Equals, true) - SetSessionSystemVar(v, TiDBEnableStreaming, types.NewStringDatum("0")) + err = SetSessionSystemVar(v, TiDBEnableStreaming, types.NewStringDatum("0")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBEnableStreaming) c.Assert(err, IsNil) c.Assert(val, Equals, "OFF") c.Assert(v.EnableStreaming, Equals, false) c.Assert(v.OptimizerSelectivityLevel, Equals, DefTiDBOptimizerSelectivityLevel) - SetSessionSystemVar(v, TiDBOptimizerSelectivityLevel, types.NewIntDatum(1)) + err = SetSessionSystemVar(v, TiDBOptimizerSelectivityLevel, types.NewIntDatum(1)) + c.Assert(err, IsNil) c.Assert(v.OptimizerSelectivityLevel, Equals, 1) err = SetSessionSystemVar(v, TiDBDDLReorgWorkerCount, types.NewIntDatum(-1)) c.Assert(terror.ErrorEqual(err, ErrWrongValueForVar), IsTrue) - SetSessionSystemVar(v, TiDBDDLReorgWorkerCount, types.NewIntDatum(int64(maxDDLReorgWorkerCount)+1)) + err = SetSessionSystemVar(v, TiDBDDLReorgWorkerCount, types.NewIntDatum(int64(maxDDLReorgWorkerCount)+1)) + c.Assert(err, NotNil) c.Assert(terror.ErrorEqual(err, ErrWrongValueForVar), IsTrue) err = SetSessionSystemVar(v, TiDBRetryLimit, types.NewStringDatum("3")) @@ -318,12 +328,14 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(val, Equals, "OFF") c.Assert(config.GetGlobalConfig().CheckMb4ValueInUTF8, Equals, false) - SetSessionSystemVar(v, TiDBLowResolutionTSO, types.NewStringDatum("1")) + err = SetSessionSystemVar(v, TiDBLowResolutionTSO, types.NewStringDatum("1")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBLowResolutionTSO) c.Assert(err, IsNil) c.Assert(val, Equals, "ON") c.Assert(v.LowResolutionTSO, Equals, true) - SetSessionSystemVar(v, TiDBLowResolutionTSO, types.NewStringDatum("0")) + err = SetSessionSystemVar(v, TiDBLowResolutionTSO, types.NewStringDatum("0")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBLowResolutionTSO) c.Assert(err, IsNil) c.Assert(val, Equals, "OFF") @@ -417,17 +429,20 @@ func (s *testVarsutilSuite) TestVarsutil(c *C) { c.Assert(val, Equals, "5.0") c.Assert(v.ConcurrencyFactor, Equals, 5.0) - SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("follower")) + err = SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("follower")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBReplicaRead) c.Assert(err, IsNil) c.Assert(val, Equals, "follower") c.Assert(v.GetReplicaRead(), Equals, kv.ReplicaReadFollower) - SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("leader")) + err = SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("leader")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBReplicaRead) c.Assert(err, IsNil) c.Assert(val, Equals, "leader") c.Assert(v.GetReplicaRead(), Equals, kv.ReplicaReadLeader) - SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("leader-and-follower")) + err = SetSessionSystemVar(v, TiDBReplicaRead, types.NewStringDatum("leader-and-follower")) + c.Assert(err, IsNil) val, err = GetSessionSystemVar(v, TiDBReplicaRead) c.Assert(err, IsNil) c.Assert(val, Equals, "leader-and-follower") diff --git a/store/tikv/client.go b/store/tikv/client.go index 910ee19bad5f3..f79a8fb25c3a8 100644 --- a/store/tikv/client.go +++ b/store/tikv/client.go @@ -47,6 +47,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding/gzip" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" ) // MaxRecvMsgSize set max gRPC receive message size received from server. If any message size is larger than @@ -70,6 +71,9 @@ const ( grpcInitialConnWindowSize = 1 << 30 ) +// forwardMetadataKey is the key of gRPC metadata which represents a forwarded request. +const forwardMetadataKey = "tikv-forwarded-host" + // Client is a client that sends RPC. // It should not be used after calling Close(). type Client interface { @@ -354,6 +358,7 @@ func (c *RPCClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.R c.recycleMu.Unlock() } + // enableBatch means TiDB can send BatchCommands to the connection. It doesn't mean TiDB must do it. // TiDB will not send batch commands to TiFlash, to resolve the conflict with Batch Cop Request. enableBatch := req.StoreTp != kv.TiDB && req.StoreTp != kv.TiFlash c.recycleMu.RLock() @@ -363,9 +368,13 @@ func (c *RPCClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.R return nil, errors.Trace(err) } + // TiDB uses [gRPC-metadata](https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md) to + // indicate a request needs forwarding. gRPC doesn't support setting a metadata for each request in a stream, + // so we don't use BatchCommands for forwarding for now. + canBatch := enableBatch && req.ForwardedHost == "" // TiDB RPC server supports batch RPC, but batch connection will send heart beat, It's not necessary since // request to TiDB is not high frequency. - if config.GetGlobalConfig().TiKVClient.MaxBatchSize > 0 && enableBatch { + if config.GetGlobalConfig().TiKVClient.MaxBatchSize > 0 && canBatch { if batchReq := req.ToBatchCommandsRequest(); batchReq != nil { defer trace.StartRegion(ctx, req.Type.String()).End() return sendBatchRequest(ctx, addr, connArray.batchConn, batchReq, timeout) @@ -387,6 +396,10 @@ func (c *RPCClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.R client := tikvpb.NewTikvClient(clientConn) + // Set metadata for request forwarding. Needn't forward DebugReq. + if req.ForwardedHost != "" { + ctx = metadata.AppendToOutgoingContext(ctx, forwardMetadataKey, req.ForwardedHost) + } switch req.Type { case tikvrpc.CmdBatchCop: return c.getBatchCopStreamResponse(ctx, client, req, timeout, connArray) diff --git a/store/tikv/client_test.go b/store/tikv/client_test.go index 1ce1326731fd4..fed26779f5196 100644 --- a/store/tikv/client_test.go +++ b/store/tikv/client_test.go @@ -17,16 +17,19 @@ import ( "context" "fmt" "sync" + "sync/atomic" "testing" "time" . "github.com/pingcap/check" "github.com/pingcap/errors" + "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/kvproto/pkg/tikvpb" "github.com/pingcap/tidb/store/tikv/config" "github.com/pingcap/tidb/store/tikv/tikvrpc" + "google.golang.org/grpc/metadata" ) func TestT(t *testing.T) { @@ -46,15 +49,10 @@ var _ = Suite(&testClientSuite{}) var _ = SerialSuites(&testClientFailSuite{}) var _ = SerialSuites(&testClientSerialSuite{}) -func setMaxBatchSize(size uint) { - newConf := config.DefaultConfig() - newConf.TiKVClient.MaxBatchSize = size - config.StoreGlobalConfig(&newConf) -} - func (s *testClientSerialSuite) TestConn(c *C) { - maxBatchSize := config.GetGlobalConfig().TiKVClient.MaxBatchSize - setMaxBatchSize(0) + defer config.UpdateGlobal(func(conf *config.Config) { + conf.TiKVClient.MaxBatchSize = 0 + })() client := NewRPCClient(config.Security{}) @@ -70,7 +68,6 @@ func (s *testClientSerialSuite) TestConn(c *C) { conn3, err := client.getConnArray(addr, true) c.Assert(err, NotNil) c.Assert(conn3, IsNil) - setMaxBatchSize(maxBatchSize) } func (s *testClientSuite) TestRemoveCanceledRequests(c *C) { @@ -229,3 +226,73 @@ func (s *testClientSuite) TestCollapseResolveLock(c *C) { default: } } + +func (s *testClientSuite) TestForwardMetadata(c *C) { + server, port := startMockTikvService() + c.Assert(port > 0, IsTrue) + defer server.Stop() + addr := fmt.Sprintf("%s:%d", "127.0.0.1", port) + + // Enable batch and limit the connection count to 1 so that + // there is only one BatchCommands stream. + defer config.UpdateGlobal(func(conf *config.Config) { + conf.TiKVClient.MaxBatchSize = 128 + conf.TiKVClient.GrpcConnectionCount = 1 + })() + rpcClient := NewRPCClient(config.Security{}) + defer rpcClient.closeConns() + + var checkCnt uint64 + // Check no corresponding metadata if ForwardedHost is empty. + server.setMetaChecker(func(ctx context.Context) error { + atomic.AddUint64(&checkCnt, 1) + // gRPC may set some metadata by default, e.g. "context-type". + md, ok := metadata.FromIncomingContext(ctx) + if ok { + vals := md.Get(forwardMetadataKey) + c.Assert(len(vals), Equals, 0) + } + return nil + }) + + // Prewrite represents unary-unary call. + prewriteReq := tikvrpc.NewRequest(tikvrpc.CmdPrewrite, &kvrpcpb.PrewriteRequest{}) + for i := 0; i < 3; i++ { + _, err := rpcClient.SendRequest(context.Background(), addr, prewriteReq, 10*time.Second) + c.Assert(err, IsNil) + } + // checkCnt should be 1 because BatchCommands is a stream-stream call. + c.Assert(atomic.LoadUint64(&checkCnt), Equals, uint64(1)) + + // CopStream represents unary-stream call. + copStreamReq := tikvrpc.NewRequest(tikvrpc.CmdCopStream, &coprocessor.Request{}) + _, err := rpcClient.SendRequest(context.Background(), addr, copStreamReq, 10*time.Second) + c.Assert(err, IsNil) + c.Assert(atomic.LoadUint64(&checkCnt), Equals, uint64(2)) + + checkCnt = 0 + forwardedHost := "127.0.0.1:6666" + // Check the metadata exists. + server.setMetaChecker(func(ctx context.Context) error { + atomic.AddUint64(&checkCnt, 1) + // gRPC may set some metadata by default, e.g. "context-type". + md, ok := metadata.FromIncomingContext(ctx) + c.Assert(ok, IsTrue) + vals := md.Get(forwardMetadataKey) + c.Assert(vals, DeepEquals, []string{forwardedHost}) + return nil + }) + + prewriteReq.ForwardedHost = forwardedHost + for i := 0; i < 3; i++ { + _, err = rpcClient.SendRequest(context.Background(), addr, prewriteReq, 10*time.Second) + c.Assert(err, IsNil) + } + // checkCnt should be 3 because we don't use BatchCommands for redirection for now. + c.Assert(atomic.LoadUint64(&checkCnt), Equals, uint64(3)) + + copStreamReq.ForwardedHost = forwardedHost + _, err = rpcClient.SendRequest(context.Background(), addr, copStreamReq, 10*time.Second) + c.Assert(err, IsNil) + c.Assert(atomic.LoadUint64(&checkCnt), Equals, uint64(4)) +} diff --git a/store/tikv/config/config.go b/store/tikv/config/config.go index e5fdd8f4c662b..6719c1bca1262 100644 --- a/store/tikv/config/config.go +++ b/store/tikv/config/config.go @@ -121,6 +121,18 @@ func StoreGlobalConfig(config *Config) { globalConf.Store(config) } +// UpdateGlobal updates the global config, and provide a restore function that can be used to restore to the original. +func UpdateGlobal(f func(conf *Config)) func() { + g := GetGlobalConfig() + restore := func() { + StoreGlobalConfig(g) + } + newConf := *g + f(&newConf) + StoreGlobalConfig(&newConf) + return restore +} + // ParsePath parses this path. // Path example: tikv://etcd-node1:port,etcd-node2:port?cluster=1&disableGC=false func ParsePath(path string) (etcdAddrs []string, disableGC bool, err error) { diff --git a/store/tikv/kv.go b/store/tikv/kv.go index 6930f59d6a1ef..d59081bb36b9d 100644 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -254,7 +254,7 @@ func (s *KVStore) getTimestampWithRetry(bo *Backoffer, txnScope string) (uint64, // Before PR #8743, we don't cleanup txn after meet error such as error like: PD server timeout // This may cause duplicate data to be written. failpoint.Inject("mockGetTSErrorInRetry", func(val failpoint.Value) { - if val.(bool) && !kv.IsMockCommitErrorEnable() { + if val.(bool) && !IsMockCommitErrorEnable() { err = ErrPDServerTimeout.GenWithStackByArgs("mock PD timeout") } }) diff --git a/store/tikv/mock_tikv_service_test.go b/store/tikv/mock_tikv_service_test.go index d86c90bb10d41..5ad7b023b1e9d 100644 --- a/store/tikv/mock_tikv_service_test.go +++ b/store/tikv/mock_tikv_service_test.go @@ -1,10 +1,14 @@ package tikv import ( + "context" "fmt" "net" + "sync" "time" + "github.com/pingcap/kvproto/pkg/coprocessor" + "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/tikvpb" "github.com/pingcap/tidb/store/tikv/logutil" "go.uber.org/zap" @@ -13,9 +17,33 @@ import ( type server struct { tikvpb.TikvServer + grpcServer *grpc.Server + // metaChecker check the metadata of each request. Now only requests + // which need redirection set it. + metaChecker struct { + sync.Mutex + check func(context.Context) error + } +} + +func (s *server) KvPrewrite(ctx context.Context, req *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error) { + if err := s.checkMetadata(ctx); err != nil { + return nil, err + } + return &kvrpcpb.PrewriteResponse{}, nil +} + +func (s *server) CoprocessorStream(req *coprocessor.Request, ss tikvpb.Tikv_CoprocessorStreamServer) error { + if err := s.checkMetadata(ss.Context()); err != nil { + return err + } + return ss.Send(&coprocessor.Response{}) } func (s *server) BatchCommands(ss tikvpb.Tikv_BatchCommandsServer) error { + if err := s.checkMetadata(ss.Context()); err != nil { + return err + } for { req, err := ss.Recv() if err != nil { @@ -43,8 +71,27 @@ func (s *server) BatchCommands(ss tikvpb.Tikv_BatchCommandsServer) error { } } +func (s *server) setMetaChecker(check func(context.Context) error) { + s.metaChecker.Lock() + s.metaChecker.check = check + s.metaChecker.Unlock() +} + +func (s *server) checkMetadata(ctx context.Context) error { + s.metaChecker.Lock() + defer s.metaChecker.Unlock() + if s.metaChecker.check != nil { + return s.metaChecker.check(ctx) + } + return nil +} + +func (s *server) Stop() { + s.grpcServer.Stop() +} + // Try to start a gRPC server and retrun the server instance and binded port. -func startMockTikvService() (*grpc.Server, int) { +func startMockTikvService() (*server, int) { port := -1 lis, err := net.Listen("tcp", fmt.Sprintf("%s:%d", "127.0.0.1", 0)) if err != nil { @@ -53,8 +100,11 @@ func startMockTikvService() (*grpc.Server, int) { return nil, port } port = lis.Addr().(*net.TCPAddr).Port + + server := &server{} s := grpc.NewServer(grpc.ConnectionTimeout(time.Minute)) - tikvpb.RegisterTikvServer(s, &server{}) + tikvpb.RegisterTikvServer(s, server) + server.grpcServer = s go func() { if err = s.Serve(lis); err != nil { logutil.BgLogger().Error( @@ -63,5 +113,5 @@ func startMockTikvService() (*grpc.Server, int) { ) } }() - return s, port + return server, port } diff --git a/store/tikv/region_cache.go b/store/tikv/region_cache.go index 2b7f2ba041420..ae6832c18625e 100644 --- a/store/tikv/region_cache.go +++ b/store/tikv/region_cache.go @@ -236,8 +236,8 @@ type RegionCache struct { mu struct { sync.RWMutex // mutex protect cached region - regions map[RegionVerID]*Region // cached regions be organized as regionVerID to region ref mapping - sorted *btree.BTree // cache regions be organized as sorted key to region ref mapping + regions map[RegionVerID]*Region // cached regions are organized as regionVerID to region ref mapping + sorted *btree.BTree // cache regions are organized as sorted key to region ref mapping } storeMu struct { sync.RWMutex diff --git a/store/tikv/test_util.go b/store/tikv/test_util.go index ea309f33fd789..7f4623ac20b00 100644 --- a/store/tikv/test_util.go +++ b/store/tikv/test_util.go @@ -14,6 +14,8 @@ package tikv import ( + "sync/atomic" + "github.com/google/uuid" "github.com/pingcap/errors" pd "github.com/tikv/pd/client" @@ -42,3 +44,21 @@ func NewTestTiKVStore(client Client, pdClient pd.Client, clientHijack func(Clien tikvStore.mock = true return tikvStore, errors.Trace(err) } + +// mockCommitErrorEnable uses to enable `mockCommitError` and only mock error once. +var mockCommitErrorEnable = int64(0) + +// MockCommitErrorEnable exports for gofail testing. +func MockCommitErrorEnable() { + atomic.StoreInt64(&mockCommitErrorEnable, 1) +} + +// MockCommitErrorDisable exports for gofail testing. +func MockCommitErrorDisable() { + atomic.StoreInt64(&mockCommitErrorEnable, 0) +} + +// IsMockCommitErrorEnable exports for gofail testing. +func IsMockCommitErrorEnable() bool { + return atomic.LoadInt64(&mockCommitErrorEnable) == 1 +} diff --git a/store/tikv/tikv_test.go b/store/tikv/tikv_test.go index a97e0bcdae8c2..81af86f998ed3 100644 --- a/store/tikv/tikv_test.go +++ b/store/tikv/tikv_test.go @@ -41,3 +41,16 @@ type testTiKVSuite struct { } var _ = Suite(&testTiKVSuite{}) + +func (s *testTiKVSuite) TestBasicFunc(c *C) { + if IsMockCommitErrorEnable() { + defer MockCommitErrorEnable() + } else { + defer MockCommitErrorDisable() + } + + MockCommitErrorEnable() + c.Assert(IsMockCommitErrorEnable(), IsTrue) + MockCommitErrorDisable() + c.Assert(IsMockCommitErrorEnable(), IsFalse) +} diff --git a/store/tikv/tikvrpc/tikvrpc.go b/store/tikv/tikvrpc/tikvrpc.go index ed4da00e146a9..bba680274f2c0 100644 --- a/store/tikv/tikvrpc/tikvrpc.go +++ b/store/tikv/tikvrpc/tikvrpc.go @@ -176,6 +176,11 @@ type Request struct { ReplicaReadType kv.ReplicaReadType // different from `kvrpcpb.Context.ReplicaRead` ReplicaReadSeed *uint32 // pointer to follower read seed in snapshot/coprocessor StoreTp kv.StoreType + // ForwardedHost is the address of a store which will handle the request. It's different from + // the address the request sent to. + // If it's not empty, the store which receive the request will forward it to + // the forwarded host. It's useful when network partition occurs. + ForwardedHost string } // NewRequest returns new kv rpc request. @@ -202,6 +207,22 @@ func NewReplicaReadRequest(typ CmdType, pointer interface{}, replicaReadType kv. return req } +// EnableStaleRead enables stale read +func (req *Request) EnableStaleRead() { + req.StaleRead = true + req.ReplicaReadType = kv.ReplicaReadMixed + req.ReplicaRead = false +} + +// IsDebugReq check whether the req is debug req. +func (req *Request) IsDebugReq() bool { + switch req.Type { + case CmdDebugGetRegionProperties: + return true + } + return false +} + // Get returns GetRequest in request. func (req *Request) Get() *kvrpcpb.GetRequest { return req.Req.(*kvrpcpb.GetRequest) @@ -397,13 +418,6 @@ func (req *Request) TxnHeartBeat() *kvrpcpb.TxnHeartBeatRequest { return req.Req.(*kvrpcpb.TxnHeartBeatRequest) } -// EnableStaleRead enables stale read -func (req *Request) EnableStaleRead() { - req.StaleRead = true - req.ReplicaReadType = kv.ReplicaReadMixed - req.ReplicaRead = false -} - // ToBatchCommandsRequest converts the request to an entry in BatchCommands request. func (req *Request) ToBatchCommandsRequest() *tikvpb.BatchCommandsRequest_Request { switch req.Type { @@ -463,15 +477,6 @@ func (req *Request) ToBatchCommandsRequest() *tikvpb.BatchCommandsRequest_Reques return nil } -// IsDebugReq check whether the req is debug req. -func (req *Request) IsDebugReq() bool { - switch req.Type { - case CmdDebugGetRegionProperties: - return true - } - return false -} - // Response wraps all kv/coprocessor responses. type Response struct { Resp interface{} diff --git a/store/tikv/txn.go b/store/tikv/txn.go index 382586cd746f9..d0d4b0703880b 100644 --- a/store/tikv/txn.go +++ b/store/tikv/txn.go @@ -222,8 +222,8 @@ func (txn *KVTxn) Commit(ctx context.Context) error { defer txn.close() failpoint.Inject("mockCommitError", func(val failpoint.Value) { - if val.(bool) && kv.IsMockCommitErrorEnable() { - kv.MockCommitErrorDisable() + if val.(bool) && IsMockCommitErrorEnable() { + MockCommitErrorDisable() failpoint.Return(errors.New("mock commit error")) } })