gh-ost/go/base
Andrew Mason b751499091
Cancel any row count queries before attempting to cut over (#846)
* Cancel any row count queries before attempting to cut over

Closes #830. Switches from using `QueryRow` to `QueryRowContext`, and
stores a context.CancelFunc in the migration context, which is called to
halt any running row count query before beginning the cut over.

* Make it threadsafe

* Kill the count query on the database side as well

* Explicitly grab a connection to run the count, store its connection id
* When the query context is canceled, run a `KILL QUERY ?` on that connection id

* Rewrite these to use the threadsafe functions, stop exporting the cancel func

* Update logger

* Update logger

Co-authored-by: Tim Vaillancourt <timvaillancourt@github.com>
Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
2022-07-07 00:23:23 +02:00
..
context_test.go Add golangci-lint CI action, fix gosimple, govet + unused lint errors (#1127) 2022-05-31 21:23:39 +02:00
context.go Cancel any row count queries before attempting to cut over (#846) 2022-07-07 00:23:23 +02:00
default_logger.go Add golangci-lint CI action, fix gosimple, govet + unused lint errors (#1127) 2022-05-31 21:23:39 +02:00
load_map_test.go Add go mod (#935) 2021-06-24 20:19:37 +02:00
load_map.go Throttling & critical load 2016-06-18 21:12:07 +02:00
utils_test.go Add go mod (#935) 2021-06-24 20:19:37 +02:00
utils.go Add golangci-lint CI action, fix gosimple, govet + unused lint errors (#1127) 2022-05-31 21:23:39 +02:00