Skip to content

Commit

Permalink
Merge branch 'slack-19.0' into allow-recovery-flag_slack-19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
timvaillancourt authored Oct 30, 2024
2 parents 7d65980 + a768745 commit 65f6c8a
Show file tree
Hide file tree
Showing 27 changed files with 242 additions and 104 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ require (
github.com/planetscale/vtprotobuf v0.5.0
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/common v0.49.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/sjmudd/stopwatch v0.1.1
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.8.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,6 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 h1:Qp27Idfgi6ACvFQat5+VJvlYToylpM/hcyLBI3WaKPA=
Expand Down
Binary file added go/cmd/vtgateproxy/vtgateproxy
Binary file not shown.
2 changes: 2 additions & 0 deletions go/flags/endtoend/topo2topo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Flags:
--from_root string topology server root to copy data from
--from_server string topology server address to copy data from
--grpc_enable_tracing Enable gRPC tracing.
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_prometheus Enable gRPC monitoring with Prometheus.
-h, --help help for topo2topo
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtbackup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ Flags:
--grpc_initial_window_size int gRPC initial window size
--grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
--grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_prometheus Enable gRPC monitoring with Prometheus.
-h, --help help for vtbackup
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtcombo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtctlclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Usage of vtctlclient:
--grpc_initial_window_size int gRPC initial window size
--grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
--grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_prometheus Enable gRPC monitoring with Prometheus.
-h, --help display usage and exit
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtctldclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Flags:
--grpc_initial_window_size int gRPC initial window size
--grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
--grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_prometheus Enable gRPC monitoring with Prometheus.
-h, --help help for vtctldclient
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtgate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtgateclienttest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vtorc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Flags:
--grpc_initial_window_size int gRPC initial window size
--grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
--grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_prometheus Enable gRPC monitoring with Prometheus.
-h, --help help for vtorc
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
2 changes: 2 additions & 0 deletions go/flags/endtoend/vttestserver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Flags:
--grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS
--grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s)
--grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s)
--grpc_max_message_recv_size int Maximum allowed RPC message size when receiving. If 0, defaults to grpc_max_message_size.
--grpc_max_message_send_size int Maximum allowed RPC message size when sending. If 0, defaults to grpc_max_message_size.
--grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
--grpc_port int Port to listen on for gRPC calls. If zero, do not listen.
--grpc_prometheus Enable gRPC monitoring with Prometheus.
Expand Down
49 changes: 38 additions & 11 deletions go/vt/external/golib/sqlutils/sqlite_dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ var sqlite3GeneralConversions = []regexpMap{
rmap(`(?i)\bconcat[(][\s]*([^,)]+)[\s]*,[\s]*([^,)]+)[\s]*,[\s]*([^,)]+)[\s]*[)]`, `($1 || $2 || $3)`),

rmap(`(?i) rlike `, ` like `),
}

var sqlite3CreateIndexConversions = []regexpMap{
rmap(`(?i)create index([\s\S]+)[(][\s]*[0-9]+[\s]*[)]([\s\S]+)`, `create index ${1}${2}`),
}

var sqlite3DropIndexConversions = []regexpMap{
rmap(`(?i)drop index ([\S]+) on ([\S]+)`, `drop index if exists $1`),
}

Expand Down Expand Up @@ -115,20 +120,42 @@ func ToSqlite3CreateTable(statement string) string {
return applyConversions(statement, sqlite3CreateTableConversions)
}

func ToSqlite3CreateIndex(statement string) string {
return applyConversions(statement, sqlite3CreateIndexConversions)
}

func ToSqlite3DropIndex(statement string) string {
return applyConversions(statement, sqlite3DropIndexConversions)
}

func ToSqlite3Insert(statement string) string {
statement = applyConversions(statement, sqlite3GeneralConversions)
return applyConversions(statement, sqlite3InsertConversions)
}

func ToSqlite3Dialect(statement string) (translated string) {
if IsCreateTable(statement) {
return ToSqlite3CreateTable(statement)
}
if IsAlterTable(statement) {
return ToSqlite3CreateTable(statement)
}
statement = applyConversions(statement, sqlite3GeneralConversions)
if IsInsert(statement) {
return ToSqlite3Insert(statement)
// ToSqlite3Dialect converts a statement to sqlite3 dialect. The statement
// is checked in this order:
// 1. If a query, return the statement with sqlite3GeneralConversions applied.
// 2. If an insert/replace, convert with ToSqlite3Insert.
// 3. If a create index, convert with IsCreateIndex.
// 4. If an drop table, convert with IsDropIndex.
// 5. If a create table, convert with IsCreateTable.
// 6. If an alter table, convert with IsAlterTable.
// 7. As fallback, return the statement with sqlite3GeneralConversions applied.
func ToSqlite3Dialect(statement string, potentiallyDMLOrDDL bool) (translated string) {
if potentiallyDMLOrDDL {
switch {
case IsInsert(statement):
return ToSqlite3Insert(statement)
case IsCreateIndex(statement):
return ToSqlite3CreateIndex(statement)
case IsDropIndex(statement):
return ToSqlite3DropIndex(statement)
case IsCreateTable(statement):
return ToSqlite3CreateTable(statement)
case IsAlterTable(statement):
return ToSqlite3CreateTable(statement)
}
}
return statement
return applyConversions(statement, sqlite3GeneralConversions)
}
Loading

0 comments on commit 65f6c8a

Please sign in to comment.