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: pause backup schedule in TestFullClusterBackup #71907

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

rhu713
Copy link
Contributor

@rhu713 rhu713 commented Oct 24, 2021

Currently the backup schedule in TestFullClusterBackup can be processed by the
job scheduler in the original DB after the backup has been taken, thus causing
a difference between the original and restored clusters. Prevent this
processing by setting the first run in the future and pausing the schedule.

Fixes #71435

Release note: None

@rhu713 rhu713 requested review from a team and dt and removed request for a team October 24, 2021 22:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Currently the backup schedule in TestFullClusterBackup can be processed by the
job scheduler in the original DB after the backup has been taken, thus causing
a difference between the original and restored clusters. Prevent this
processing by setting the first run in the future and pausing the schedule.

Fixes cockroachdb#71435

Release note: None
Copy link
Collaborator

@stevendanna stevendanna 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 @dt and @rhu713)


pkg/ccl/backupccl/full_cluster_backup_restore_test.go, line 151 at r1 (raw file):

	// Populate system.scheduled_jobs table with a first run in the future to prevent immediate adoption.
	firstRun := timeutil.Now().Add(time.Hour).Format(timeutil.TimestampWithoutTZFormat)
	sqlDB.Exec(t, `CREATE SCHEDULE FOR BACKUP data.bank INTO $1 RECURRING '@hourly' FULL BACKUP ALWAYS WITH SCHEDULE OPTIONS first_run = $2`, LocalFoo, firstRun)

Ah nice. I think when we were looking at the test failure we erroneously misread the output as being about the sql stats compaction job. I wonder though, is it possible that the same sort of issue happens with the stats compaction job?

Copy link
Contributor Author

@rhu713 rhu713 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 @dt and @stevendanna)


pkg/ccl/backupccl/full_cluster_backup_restore_test.go, line 151 at r1 (raw file):

Previously, stevendanna (Steven Danna) wrote…

Ah nice. I think when we were looking at the test failure we erroneously misread the output as being about the sql stats compaction job. I wonder though, is it possible that the same sort of issue happens with the stats compaction job?

I think it's unlikely for the stats compaction job since there's a 2-5 minute delay for the first scan of the job scheduler, and the stats jobs are paused right away in the test. But I think in theory it could happen:
https://github.com/cockroachdb/cockroach/blob/master/pkg/jobs/job_scheduler.go#L411

@rhu713
Copy link
Contributor Author

rhu713 commented Oct 25, 2021

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 25, 2021

Build failed (retrying...):

@craig craig bot merged commit 7c50de2 into cockroachdb:master Oct 25, 2021
@craig
Copy link
Contributor

craig bot commented Oct 25, 2021

Build succeeded:

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.

ccl/backupccl: TestFullClusterBackup failed
3 participants