Skip to content

Instantly share code, notes, and snippets.

@dasl-
dasl- / foo.diff
Created September 17, 2019 23:32
diff --git a/go/cmd/mysqlctl/mysqlctl.go b/go/cmd/mysqlctl/mysqlctl.go
index da7eec12d..30aa20ecd 100644
--- a/go/cmd/mysqlctl/mysqlctl.go
+++ b/go/cmd/mysqlctl/mysqlctl.go
@@ -25,6 +25,7 @@ import (
"golang.org/x/net/context"
+ "vitess.io/vitess/go/context2"
"vitess.io/vitess/go/exit"
@dasl-
dasl- / foo.diff
Created September 17, 2019 23:39
diff --git a/go/cmd/mysqlctl/mysqlctl.go b/go/cmd/mysqlctl/mysqlctl.go
index da7eec12d..30aa20ecd 100644
--- a/go/cmd/mysqlctl/mysqlctl.go
+++ b/go/cmd/mysqlctl/mysqlctl.go
@@ -25,6 +25,7 @@ import (
"golang.org/x/net/context"
+ "vitess.io/vitess/go/context2"
"vitess.io/vitess/go/exit"
@dasl-
dasl- / foo.diff
Created September 18, 2019 15:32
diff --git a/go/vt/vttablet/tabletserver/connpool/dbconn.go b/go/vt/vttablet/tabletserver/connpool/dbconn.go
index f505dff7d..c15d33878 100644
--- a/go/vt/vttablet/tabletserver/connpool/dbconn.go
+++ b/go/vt/vttablet/tabletserver/connpool/dbconn.go
@@ -123,34 +123,36 @@ func (dbc *DBConn) Exec(ctx context.Context, query string, maxrows int, wantfiel
// Return the error of the reconnect and not the original connection error.
return nil, reconnectErr
}
// Reconnect succeeded. Retry query at second attempt.
@dasl-
dasl- / foo.diff
Created September 19, 2019 23:18
diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go
index 64711af9b..319783a31 100644
--- a/go/vt/vttablet/tabletserver/tabletserver.go
+++ b/go/vt/vttablet/tabletserver/tabletserver.go
@@ -265,7 +265,7 @@ func NewTabletServerWithNilTopoServer(config tabletenv.TabletConfig) *TabletServ
func NewTabletServer(config tabletenv.TabletConfig, topoServer *topo.Server, alias topodatapb.TabletAlias) *TabletServer {
tsv := &TabletServer{
QueryTimeout: sync2.NewAtomicDuration(time.Duration(config.QueryTimeout * 1e9)),
- BeginTimeout: sync2.NewAtomicDuration(time.Duration(config.TxPoolTimeout * 1e9)),
+ BeginTimeout: sync2.NewAtomicDuration(time.Duration(config.QueryTimeout * 1e9)),
vitess@localhost:/vt/src/vitess.io/vitess$ dlv attach $(cat $VTDATAROOT/vt_0000000100/vttablet.pid) --listen=:40000 --headless --api-version=2 --log
API server listening at: [::]:40000
2019-09-23T21:42:37Z info layer=debugger attaching to pid 2448
2019-09-23T21:42:46Z info layer=debugger created breakpoint: &api.Breakpoint{ID:1, Name:"", Addr:0x103ca7f, File:"/vt/src/vitess.io/vitess/go/vt/vttablet/tabletserver/tabletserver.go", Line:360, FunctionName:"vitess.io/vitess/go/vt/vttablet/tabletserver.(*TabletServer).setState", Cond:"", Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(nil), LoadLocals:(*api.LoadConfig)(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0}
2019-09-23T21:42:46Z info layer=debugger created breakpoint: &api.Breakpoint{ID:2, Name:"", Addr:0x115c9a6, File:"/vt/src/vitess.io/vitess/go/vt/binlog/binlogplayer/dbclient.go", Line:112, FunctionName:"vitess.io/vitess/go/vt/binlog/binlogplayer.(*dbClientImpl).ExecuteFetch",
-- unsharded database
CREATE TABLE `shops_index` (
`shop_id` bigint(20) unsigned NOT NULL,
`shop_shard` int(11) NOT NULL,
`name` varchar(100) DEFAULT NULL,
PRIMARY KEY (`shop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
API server listening at: [::]:40000
2019-09-24T20:20:11Z debug layer=rpc <- RPCServer.FindLocation(rpc2.FindLocationIn{"Scope":{"GoroutineID":-1,"Frame":0,"DeferredCall":0},"Loc":"main.main"})
2019-09-24T20:20:11Z debug layer=rpc -> *rpc2.FindLocationOut{"Locations":[{"pc"..."main.main","value":21446432,"type":0,"goType":0,"optimized":false}}]} error: ""
2019-09-24T20:20:11Z debug layer=rpc <- RPCServer.ListSources(rpc2.ListSourcesIn{"Filter":""})
2019-09-24T20:20:11Z debug layer=rpc -> *rpc2.ListSourcesOut{"Sources":["/go/pkg...utogenerated\u003e","_cgo_gotypes.go","_gomod_.go","sql.y","yaccpar"]} error: ""
2019-09-24T20:20:11Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBr...ktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}})
2019-09-24T20:20:11Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{...:0,"LoadArgs":null,"LoadLocals":null,"hitCount":{},"totalHitCount":0}} error: ""
2019-09-24T20:20:11Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBr
Length: 1
"insert into shops_index(shop_id, shop_shard) values (:vtg1, :vtg2)"
{
"PlanID": "INSERT_PK",
"Reason": "DEFAULT",
"Table": {
"Name": "shops_index",
"Columns": [
{
"Name": "shop_id",
Length: 1
"insert into shop_data(shop_id, k, v) values (:vtg1, :vtg2, :vtg3)"
{
"PlanID": "INSERT_PK",
"Reason": "DEFAULT",
"Table": {
"Name": "shop_data",
"Columns": [
{
"Name": "shop_id",
[
{
"Key": "index_test@master:insert into shops_index(shop_id, shop_shard) values (:vtg1, :vtg2)",
"Value": {
"Original": "insert into shops_index(shop_id, shop_shard) values (:vtg1, :vtg2)",
"Instructions": {
"Opcode": "InsertUnsharded",
"Keyspace": {