From edf68322b2e37f33fc7676bf1c6c6b6a2375d8bb Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:54:24 +0200 Subject: [PATCH] 19.0 release notes: ExecuteFetchAsDBA breaking change (#15021) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: Deepthi Sigireddi --- changelog/19.0/19.0.0/summary.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/changelog/19.0/19.0.0/summary.md b/changelog/19.0/19.0.0/summary.md index 487495759cb..e6203044763 100644 --- a/changelog/19.0/19.0.0/summary.md +++ b/changelog/19.0/19.0.0/summary.md @@ -7,6 +7,8 @@ - **[Deprecations and Deletions](#deprecations-and-deletions)** - [VTTablet Flags](#vttablet-flags) - [MySQL binary in vitess/lite Docker image](#mysql-binary-in-lite-image) + - **[Breaking Changes](#breaking-changes)** + - [ExecuteFetchAsDBA rejects multi-statement SQL](#execute-fetch-as-dba-reject-multi) - **[New Stats](#new-stats)** - [Stream Consolidations](#stream-consolidations) - [Build Version in `/debug/vars`](#build-version-in-debug-vars) @@ -62,6 +64,22 @@ Below is an example of a kubernetes yaml file before and after upgrading to an o mysql80Compatible: mysql:8.0.30 # or even mysql:8.0.34 for instance ``` +### Breaking Changes + +#### ExecuteFetchAsDBA rejects multi-statement SQL + +`vtctldclient ExecuteFetchAsDBA` (and similarly the `vtctl` and `vtctlclient` commands) now reject multi-statement SQL with error. + +For example, `vtctldclient ExecuteFetchAsDBA my-tablet "stop replica; change replication source to auto_position=1; start replica` will return an error, without attempting to execute any of these queries. + +Previously, `ExecuteFetchAsDBA` silently accepted multi statement SQL. It would (attempt to) execute all of them, but: + +- It would only indicate error for the first statement. Errors on 2nd, 3rd, ... statements were silently ignored. +- It would not consume the result sets of the 2nd, 3rd, ... statements. It would then return the used connection to the pool in a dirty state. Any further query that happens to take that connection out of the pool could get unexpected results. +- As another side effect, multi-statement schema changes would cause schema to be reloaded with only the first change, leaving the cached schema inconsistent with the underlying database. + +`ExecuteFetchAsDBA` does allow a specific use case of multi-statement SQL, which is where all statements are in the form of `CREATE TABLE` or `CREATE VIEW`. This is to support a common pattern of schema initialization, formalized in `ApplySchema --batch-size` which uses `ExecuteFetchAsDBA` under the hood. + ### New Stats #### Stream Consolidations