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: actually enable stats at end of download job #119955

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

msbutler
Copy link
Collaborator

@msbutler msbutler commented Mar 5, 2024

PR #116977 didn't re-enable auto stats collection for online restored tables
after the download job. This patch fixes this bug.

Fixes #119935

Release note: none

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@msbutler msbutler force-pushed the butler-or-fix-stats branch 3 times, most recently from 0d8b814 to 78f6c43 Compare March 5, 2024 20:38
@msbutler msbutler self-assigned this Mar 5, 2024
@msbutler msbutler requested review from dt and stevendanna March 5, 2024 20:39
@msbutler msbutler marked this pull request as ready for review March 5, 2024 20:39
@msbutler msbutler requested a review from a team as a code owner March 5, 2024 20:39
@msbutler msbutler force-pushed the butler-or-fix-stats branch 2 times, most recently from 307af43 to adf4906 Compare March 6, 2024 17:42
@msbutler msbutler requested a review from a team as a code owner March 6, 2024 17:42
pkg/ccl/backupccl/restore_job.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/restore_online.go Outdated Show resolved Hide resolved
@dt dt removed their request for review March 12, 2024 00:56
@msbutler msbutler force-pushed the butler-or-fix-stats branch 2 times, most recently from e738de1 to 85e3ba1 Compare March 12, 2024 18:56
@msbutler msbutler force-pushed the butler-or-fix-stats branch 3 times, most recently from f547720 to 61eec83 Compare March 12, 2024 20:30
@msbutler msbutler requested a review from dt March 14, 2024 16:32
@msbutler msbutler force-pushed the butler-or-fix-stats branch 2 times, most recently from 1b8b14e to 4ab0443 Compare March 14, 2024 21:19
Previously, the download job would be written before publishing sql descriptors
in the linking job. This meant that the download job could finish before the
descriptors were published. Since we attempt to manipulate descriptors at the
end of the download job (to re-enable auto stats jobs on restored tables), the
link job could fail if it observed that the restored descriptors were modified
before they were published.

This patch also fixes another bug where cluster online restore would write two
download jobs with the same ID. Previously, the download job would be written
at the end of the `restoreWithRetry()` call. Note that during cluster restore
we call this twice-- once for certain important system tables and again for the
main restoration data. This patch creates a single download job that will track
the downloading of all spans involved in the cluster restore.

Epic: none

Release note: none
PR cockroachdb#116977 didn't re-enable auto stats collection for online restored tables
after the download job. This patch fixes this bug.

Fixes cockroachdb#119935

Release note: none
@msbutler
Copy link
Collaborator Author

TFTR!

bors r=dt

@craig
Copy link
Contributor

craig bot commented Mar 15, 2024

@craig craig bot merged commit 8c8d633 into cockroachdb:master Mar 15, 2024
16 of 22 checks passed
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.

backupccl: fix sql stats re-enablement in online restore
4 participants