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

sql,backupccl: create IMPORT ROLLBACK job in online restore #120407

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

stevendanna
Copy link
Collaborator

@stevendanna stevendanna commented Mar 13, 2024

Tables that are offline and have a non-zero ImportEpoch are now restored to their offline state and an IMPORT
ROLLBACK job is synthesized.

The IMPORT ROLLBACK job uses an epoch-based predicate delete to
rollback the table and bring it back online.

Epic: none
Release note: None

@stevendanna stevendanna requested review from a team as code owners March 13, 2024 14:39
@stevendanna stevendanna requested review from dt, jbowens and mgartner and removed request for a team March 13, 2024 14:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@stevendanna stevendanna force-pushed the import-epoch-predicate-job branch 4 times, most recently from 4cf9126 to 1615358 Compare March 19, 2024 15:18
@msbutler msbutler self-requested a review March 19, 2024 15:22
Copy link
Collaborator

@msbutler msbutler left a comment

Choose a reason for hiding this comment

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

This is great! I gave a pass at the non-test code. It looks like your test failed in CI, so I'll wait to look at it once it's green.

pkg/ccl/backupccl/restore_job.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/restore_job.go Outdated Show resolved Hide resolved
}

func (r *importRollbackResumer) OnFailOrCancel(context.Context, interface{}, error) error {
return errors.AssertionFailedf("OnFailOrCancel called on non-cancellable job %d", r.job.ID())
Copy link
Collaborator

Choose a reason for hiding this comment

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

i may have missed this somewhere: do you have to flag in job creation or in the job constructor that this job is non-cancellable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, added the bool to the job record.

@stevendanna stevendanna force-pushed the import-epoch-predicate-job branch 2 times, most recently from 23d69f7 to 1a032c9 Compare March 20, 2024 18:04
@stevendanna
Copy link
Collaborator Author

It looks like your test failed in CI, so I'll wait to look at it once it's green.

Yeah, I semantically merged-conflicted with myself.

Copy link
Collaborator

@msbutler msbutler left a comment

Choose a reason for hiding this comment

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

Looks good! just had one question about the unit test

exec-sql
BACKUP INTO 'nodelocal://1/cluster/';
----


new-cluster name=s2 share-io-dir=s1 allow-implicit-access disable-tenant
new-cluster name=s2 allow-implicit-access disable-tenant
Copy link
Collaborator

@msbutler msbutler Mar 20, 2024

Choose a reason for hiding this comment

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

nit: no need to use a new cluster. this test was written before prefix synthesis.

@stevendanna stevendanna force-pushed the import-epoch-predicate-job branch 2 times, most recently from d955392 to 1ed770f Compare March 20, 2024 22:31
@stevendanna
Copy link
Collaborator Author

bors r=msbutler

@craig
Copy link
Contributor

craig bot commented Mar 22, 2024

Build failed:

Tables that are offline and have a non-zero ImportEpoch are now
restored to their offline state and an IMPORT ROLLBACK job is
synthesized.

The IMPORT ROLLBACK job uses an epoch-based predicate delete to
rollback the table and bring it back online.

Epic: none
Release note: None
@stevendanna stevendanna force-pushed the import-epoch-predicate-job branch from 1ed770f to f2790a1 Compare March 22, 2024 04:55
@stevendanna
Copy link
Collaborator Author

bors r=msbutler

@craig
Copy link
Contributor

craig bot commented Mar 22, 2024

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

3 participants