Skip to content

backup: normalize fast restore fractionCompleted across phases#169779

Draft
msbutler wants to merge 2 commits intocockroachdb:masterfrom
msbutler:butler-fast-restore-frac-completed
Draft

backup: normalize fast restore fractionCompleted across phases#169779
msbutler wants to merge 2 commits intocockroachdb:masterfrom
msbutler:butler-fast-restore-frac-completed

Conversation

@msbutler
Copy link
Copy Markdown
Collaborator

@msbutler msbutler commented May 5, 2026

backup: normalize fast restore fractionCompleted across phases

Previously, ExperimentalCopy (fast restore) reported fractionCompleted
from 0 to 1.0 during the link phase, then reset to 0 and went back to
1.0 during the download phase, causing a visible regression in the UI.

Normalize progress so the link phase occupies the first 5% (0.0-0.05)
and the download phase occupies the remaining 95% (0.05-1.0), ensuring
fractionCompleted increases monotonically across both phases.

Epic: none
Release note: None

Co-Authored-By: roachdev-claude [email protected]

jobs: add targetFraction parameter to ChunkProgressLogger

Add a targetFraction parameter to NewChunkProgressLogger,
NewChunkProgressLoggerForJob, and DeprecatedNewChunkProgressLoggerForJob.
Previously, progress was always interpolated from startFraction to 1.0.
The new parameter allows callers to specify a different upper bound,
which is needed for multi-phase jobs where each phase occupies a
portion of the overall progress range.

All existing callers pass 1.0 to preserve current behavior.

We modify the deprecated API rather than migrating restore off it because
the deprecated chunk progress logger is currently coupled to checkpoint
frontier persistence via updateJobCallback. Migrating to the new API
would also require migrating frontier persistence to the job frontier
API -- work for another day.

Epic: none
Release note: None

Co-Authored-By: roachdev-claude [email protected]

msbutler and others added 2 commits May 5, 2026 16:55
Add a `targetFraction` parameter to `NewChunkProgressLogger`,
`NewChunkProgressLoggerForJob`, and `DeprecatedNewChunkProgressLoggerForJob`.
Previously, progress was always interpolated from `startFraction` to 1.0.
The new parameter allows callers to specify a different upper bound,
which is needed for multi-phase jobs where each phase occupies a
portion of the overall progress range.

All existing callers pass 1.0 to preserve current behavior.

We modify the deprecated API rather than migrating restore off it because
the deprecated chunk progress logger is currently coupled to checkpoint
frontier persistence via `updateJobCallback`. Migrating to the new API
would also require migrating frontier persistence to the job frontier
API -- work for another day.

Epic: none
Release note: None

Co-Authored-By: roachdev-claude <[email protected]>
Previously, ExperimentalCopy (fast restore) reported fractionCompleted
from 0 to 1.0 during the link phase, then reset to 0 and went back to
1.0 during the download phase, causing a visible regression in the UI.

Normalize progress so the link phase occupies the first 5% (0.0-0.05)
and the download phase occupies the remaining 95% (0.05-1.0), ensuring
fractionCompleted increases monotonically across both phases.

Epic: none
Release note: None

Co-Authored-By: roachdev-claude <[email protected]>
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 5, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@msbutler msbutler self-assigned this May 5, 2026
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.

2 participants