You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ApplySchema --batch-size sees two different problems, both caused by the fact we run batched commands via ExecuteFetchAsDBA RPC.
When running with --ddl-strategy="direct --allow-zero-in-date, and when --batch-size > 1, and when multiple queries supplied in --sql, then parsing of the injected /*vt+ allowZeroInDate=true */ fails. This is because ExecuteFetchAsDBA implementation in server/engine assumes the received SQL contains a single statement:
Related to ExecuteFetch misbehavior when running multiple queies #14948, when we apply multiple CREATE TABLE... statements, we do only consume the result set of the first statement. This blocks 2nd and 3rd, ... statements from running, and as result this ReloadSchema code only sees the 1st table:
This issue affects release-18.0. Because both vtctld and vttablet are involved, there is no single bugfix that will make everything right. We should:
Offer a solution that is "good enough" for both current + v18
Offer a moving-forward solution that will apply in v19&v20, based on enhanced RPC.
Reproduction Steps
In examples/101, run the following:
vtctldclient ApplySchema --ddl-strategy="direct --allow-zero-in-date" --batch-size=5 --sql "create table if not exists t1 (id int primary key); create table if not exists t2 (id int primary key); create table if not exists t3 (id int primary key);" commerce
Tail the PRIMARY tablet logs. You will see:
Jan 15 06:15:45 I0115 06:15:45.561796 316725 rpc_schema.go:57] ReloadSchema requested via RPC
Jan 15 06:15:45 I0115 06:15:45.575769 316725 engine.go:551] schema engine created [t1], altered [], dropped []
In the above only t1 gets reloaded.
Binary Version
v18
current (v19)
Operating System and Environment details
-
Log Fragments
No response
The text was updated successfully, but these errors were encountered:
Overview of the Issue
ApplySchema --batch-size
sees two different problems, both caused by the fact we run batched commands viaExecuteFetchAsDBA
RPC.--ddl-strategy="direct --allow-zero-in-date
, and when--batch-size
> 1, and when multiple queries supplied in--sql
, then parsing of the injected/*vt+ allowZeroInDate=true */
fails. This is becauseExecuteFetchAsDBA
implementation in server/engine assumes the received SQL contains a single statement:vitess/go/vt/vttablet/tabletmanager/rpc_query.go
Lines 60 to 64 in ca4246d
ExecuteFetch
misbehavior when running multiple queies #14948, when we apply multipleCREATE TABLE...
statements, we do only consume the result set of the first statement. This blocks 2nd and 3rd, ... statements from running, and as result thisReloadSchema
code only sees the 1st table:vitess/go/vt/vttablet/tabletmanager/rpc_query.go
Lines 88 to 93 in ca4246d
The rest of the statements/tables do get applied when the connection is terminated, which makes this issue evasive.
Related: #13693
This issue affects
release-18.0
. Because bothvtctld
andvttablet
are involved, there is no single bugfix that will make everything right. We should:v18
v19
&v20
, based on enhanced RPC.Reproduction Steps
In examples/101, run the following:
Tail the
PRIMARY
tablet logs. You will see:In the above only
t1
gets reloaded.Binary Version
Operating System and Environment details
Log Fragments
No response
The text was updated successfully, but these errors were encountered: