Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online DDL: ALTER VIEW and INSTANT migrations do not respect ddl strategy's --postpone-completion #11898

Closed
shlomi-noach opened this issue Dec 7, 2022 · 0 comments · Fixed by #11910

Comments

@shlomi-noach
Copy link
Contributor

When submitting for example this Online DDL, and assuming view v exists:

vtctlclient -- ApplySchema --skip_preflight --ddl_strategy "online  --allow-zero-in-date --allow-concurrent --postpone-completion" --sql "alter view v as select 17 from dual" commerce

the scheduler runs the statement to immediate completion, even though --postpone-completion is specified.

This happens because originally we were only dealing with tables. We only considered CREATE and DROP statements to be "immediate", and assumed that all ALTER statements are handled by gh-ost or vreplication. But an ALTER VIEW is an immediate operation, too, and this needs to be taken into consideration.

The new (and still undocumented --prefer-instant-ddl) flag also does not respect --postpone-completion. For example:

vtctlclient -- ApplySchema --skip_preflight --ddl_strategy "online  --allow-zero-in-date --allow-concurrent --postpone-completion --prefer-instant-ddl" --sql "alter table corder add column i2 int not null default 0" commerce

Here, the problem is that the query is sent to run, but it's only at that stage that it is processed and evaluated, and found to be eligible to INSTANT ddl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant