Skip to content

backupccl: deflake test reading job record#45369

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
dt:backup-test-flake
Feb 26, 2020
Merged

backupccl: deflake test reading job record#45369
craig[bot] merged 1 commit intocockroachdb:masterfrom
dt:backup-test-flake

Conversation

@dt
Copy link
Copy Markdown
Contributor

@dt dt commented Feb 25, 2020

These tests read the job created by a backup directly from the jobs table
immediately after running the backup to verify which fields the raw job
does or does not contain. However background jobs like table statistics
mean that the test cannot always assume that the job it just ran is exactly
the most recent row in the jobs table.

Previously the test attempted to solve this by disabling automatic stats,
but this settings change is not instant and races with the stats process.
In some rare cases, the test was thus encountering unexpected stats jobs
when it expected backup jobs.

Instead of disabling stats, this changes the test to look the 10 most recent
jobs and filter out those that are backups to check the fields they
do or don't contain. This side-steps the inexact timing of disabling stats,
and indeed allows leaving them enabled, which is nice given that the test
is also testing their handling within backups.

Fixes #44985.

Release note: none.

@dt dt requested a review from pbardea February 25, 2020 06:29
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@dt dt force-pushed the backup-test-flake branch from 299b54b to fcc550c Compare February 25, 2020 06:30
These tests read the job created by a backup directly from the jobs table
immediately after running the backup to verify which fields the raw job
does or does not contain. However background jobs like table statistics
mean that the test cannot always assume that the job it just ran is exactly
the most recent row in the jobs table.

Previously the test attempted to solve this by disabling automatic stats,
but this settings change is not instant and races with the stats process.
In some rare cases, the test was thus encountering unexpected stats jobs
when it expected backup jobs.

Instead of disabling stats, this changes the test to look the 10 most recent
jobs and filter out those that are backups to check the fields they
do or don't contain. This side-steps the inexact timing of disabling stats,
and indeed allows leaving them enabled, which is nice given that the test
is also testing their handling within backups.

Release note: none.
Copy link
Copy Markdown
Contributor

@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.

LGTM, would this also affect tests which use latestJobId()?

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

@dt
Copy link
Copy Markdown
Contributor Author

dt commented Feb 26, 2020

Seems likely -- i think most of those users are skipped, potentially because of this. Let's look at that in a separate follow-up.

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 26, 2020

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 26, 2020

Build succeeded

@craig craig bot merged commit dc423c3 into cockroachdb:master Feb 26, 2020
@dt dt deleted the backup-test-flake branch March 5, 2020 20:16
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: TestBackupRestoreNegativePrimaryKey failed

3 participants