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

backupccl: do not re-create schema change jobs in cluster restore #55973

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

pbardea
Copy link
Contributor

@pbardea pbardea commented Oct 26, 2020

This commit fixes a bug where schema change jobs that were in progress
during a cluster backup would be re-created twice during a cluster
restore.

Release note (bug fix): Previously if a cluster backup that was taken
during a schema change, a cluster restore of that backup would create
duplicates of the ongoing schema changes.

@pbardea pbardea requested review from a team and miretskiy and removed request for a team October 26, 2020 14:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy and @pbardea)


pkg/ccl/backupccl/restore_job.go, line 1374 at r1 (raw file):

		if details.DescriptorCoverage != tree.AllDescriptors {
			// Convert any mutations that were in progress on the table descriptor
			// when the backup was taken, and convert them to schema change jobs.

Perhaps expand the comment a bit to indicate why we're not doing this for allDescriptors?

Copy link
Contributor Author

@pbardea pbardea left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy)


pkg/ccl/backupccl/restore_job.go, line 1374 at r1 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

Perhaps expand the comment a bit to indicate why we're not doing this for allDescriptors?

Agreed. Done.

This commit fixes a bug where schema change jobs that were in progress
during a cluster backup would be re-created twice during a cluster
restore.

Release note (bug fix): Previously if a cluster backup that was taken
during a schema change, a cluster restore of that backup would create
duplicates of the ongoing schema changes.
This commit expands the mid schema change restore tests to test both
table and cluster restore of backups that had ongoing schema changes.

This commit also adds test cases for when a schema change has not
performed the backfill. This is in addition to the existing cases where
the backfill has already been performed.

Release note: None
@pbardea
Copy link
Contributor Author

pbardea commented Oct 26, 2020

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented Oct 26, 2020

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Contributor

craig bot commented Oct 26, 2020

Build succeeded:

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

Successfully merging this pull request may close these issues.

4 participants