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

sql: Skip creation/update of job for schema change in same txn as CREATE #39819

Merged
merged 1 commit into from
Aug 22, 2019

Conversation

adityamaru27
Copy link
Contributor

Previously, we would unconditionally create a job for a schema change
issued in the same txn as the one in which its table was created. This
is contrary to how we would handle these schema changes. In such
scenarios schema changes would be applied synchronously without using
the schema changer. Thus, these jobs would indefinitely remain in a pending
state.

This change adds a condition to check whether job creation is necessary.
It fixes one symptom of #39667.

Release note: None

Previously, we would unconditionally create a job for a schema change
issued in the same txn as the one in which its table was created. This
is contrary to how we would handle these schema changes. In such
scenarios schema changes would be applied synchronously without using
the schema changer. Thus, these jobs would indefinitely remain in a pending
state.

This change adds a condition to check whether job creation is necessary.
It fixes one symptom of cockroachdb#39667.

Release note: None
@adityamaru27 adityamaru27 requested review from dt and BramGruneir August 22, 2019 14:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @BramGruneir)

@adityamaru27
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Aug 22, 2019
39819: sql: Skip creation/update of job for schema change in same txn as CREATE r=adityamaru27 a=adityamaru27

Previously, we would unconditionally create a job for a schema change
issued in the same txn as the one in which its table was created. This
is contrary to how we would handle these schema changes. In such
scenarios schema changes would be applied synchronously without using
the schema changer. Thus, these jobs would indefinitely remain in a pending
state.

This change adds a condition to check whether job creation is necessary.
It fixes one symptom of #39667.

Release note: None

Co-authored-by: Aditya Maru <[email protected]>
@craig
Copy link
Contributor

craig bot commented Aug 22, 2019

Build succeeded

@awoods187
Copy link
Contributor

Does this need to be backported? @BramGruneir @dt @lucy-zhang

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

Successfully merging this pull request may close these issues.

4 participants