Skip to content

Commit

Permalink
set vreplication net read and net write timeout session vars to high …
Browse files Browse the repository at this point in the history
…values

Signed-off-by: Olga Shestopalova <[email protected]>
  • Loading branch information
Olga Shestopalova committed Oct 6, 2023
1 parent 370696b commit a1249d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/vt/vttablet/tabletmanager/vreplication/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ func (ct *controller) runBlp(ctx context.Context) (err error) {
if _, err := dbClient.ExecuteFetch("set names 'binary'", 10000); err != nil {
return err
}
if _, err := dbClient.ExecuteFetch("set @@session.net_read_timeout = 300", 10000); err != nil {
return err
}
if _, err := dbClient.ExecuteFetch("set @@session.net_write_timeout = 600", 10000); err != nil {
return err
}
// We must apply AUTO_INCREMENT values precisely as we got them. This include the 0 value, which is not recommended in AUTO_INCREMENT, and yet is valid.
if _, err := dbClient.ExecuteFetch("set @@session.sql_mode = CONCAT(@@session.sql_mode, ',NO_AUTO_VALUE_ON_ZERO')", 10000); err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ func (rs *rowStreamer) Stream() error {
if _, err := rs.conn.ExecuteFetch("set names 'binary'", 1, false); err != nil {
return err
}
if _, err := conn.ExecuteFetch("set @@session.net_read_timeout = 300", 1, false); err != nil {
return err
}
if _, err := conn.ExecuteFetch("set @@session.net_write_timeout = 600", 1, false); err != nil {
return err
}
}
return rs.streamQuery(rs.send)
}
Expand Down
6 changes: 6 additions & 0 deletions go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ func (ts *tableStreamer) Stream() error {
if _, err := conn.ExecuteFetch("set names 'binary'", 1, false); err != nil {
return err
}
if _, err := conn.ExecuteFetch("set @@session.net_read_timeout = 300", 1, false); err != nil {
return err
}
if _, err := conn.ExecuteFetch("set @@session.net_write_timeout = 600", 1, false); err != nil {
return err
}

rs, err := conn.ExecuteFetch("show tables", -1, true)
if err != nil {
Expand Down

0 comments on commit a1249d1

Please sign in to comment.