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

revertccl: ALTER VIRTUAL CLUSTER RESET DATA #117429

Merged
merged 6 commits into from
Jan 10, 2024
Merged

Conversation

dt
Copy link
Member

@dt dt commented Jan 5, 2024

This enables resetting a virtual cluster's data to a prior timestamp.

This is possible if the prior timestamp is still retained in the mvcc
history of the virtual cluster, the virtual cluster has stopped service,
and is run by a user with the MANAGEVIRTUALCLUSTER (or admin) privilege
in the system tenant.

Revisions of data in the system tenant newer than the target time to
which it is being reset are destroyed, reverting the tenant to the state
it was in as of the time reverted to. Destroyed revisions are not
recoverable; once a tenant has been reset to a timestamp, it cannot be
'un-reset' back to a higher timestamp.

Release note (cluster virtualization): Added a new 'flashback' command
to revert a virtual cluster to an earlier state using ALTER VIRTUAL
CLUSTER RESET DATA.

Epic: CRDB-34233.

@dt dt requested a review from stevendanna January 5, 2024 22:10
@dt dt requested review from a team as code owners January 5, 2024 22:10
@dt dt requested review from yuzefovich and removed request for a team January 5, 2024 22:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich removed their request for review January 6, 2024 01:56
@dt dt force-pushed the pcr/reset-data branch from 396d3c6 to 7c18055 Compare January 9, 2024 13:51
@dt dt force-pushed the pcr/reset-data branch 3 times, most recently from d8ab833 to 6632c78 Compare January 9, 2024 14:41
@dt dt changed the title streamingest: ALTER VIRTUAL CLUSTER RESET DATA revertccl: ALTER VIRTUAL CLUSTER RESET DATA Jan 9, 2024
dt added 2 commits January 9, 2024 15:53
Release note: none.
Epic: none.
@dt dt force-pushed the pcr/reset-data branch from 6632c78 to 80f990a Compare January 9, 2024 15:53
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.

Nice to have this as user-facing syntax.

As a follow up perhaps we can remove the crdb_internal function?

pkg/ccl/revertccl/revert_tenant.go Outdated Show resolved Hide resolved
@dt
Copy link
Member Author

dt commented Jan 9, 2024

remove the crdb_internal function?

I'll do it now if you're not concerned about having both side-by-side for a release?

dt added 4 commits January 9, 2024 18:37
Release note: none.
Epic: none.
Release note: none.
Epic: none.
This enables resetting a virtual cluster's data to a prior timestamp.

This is possible if the prior timestamp is still retained in the mvcc
history of the virtual cluster, the virtual cluster has stopped service,
and is run by a user with the MANAGEVIRTUALCLUSTER (or admin) privilege
in the system tenant.

Revisions of data in the system tenant newer than the target time to
which it is being reset are destroyed, reverting the tenant to the state
it was in as of the time reverted to. Destroyed revisions are not
recoverable; once a tenant has been reset to a timestamp, it cannot be
'un-reset' back to a higher timestamp.

Release note (cluster virtualization): Added a new 'flashback' command
to revert a virtual cluster to an earlier state using ALTER VIRTUAL
CLUSTER RESET DATA.

Epic: CRDB-34233.
Release note: none.
Epic: none.
@dt dt force-pushed the pcr/reset-data branch from b89178c to 7d6d7f2 Compare January 9, 2024 18:37
@dt
Copy link
Member Author

dt commented Jan 9, 2024

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 9, 2024

Build failed (retrying...):

@craig craig bot merged commit 3bcf088 into cockroachdb:master Jan 10, 2024
9 checks passed
@craig
Copy link
Contributor

craig bot commented Jan 10, 2024

Build succeeded:

@dt dt deleted the pcr/reset-data branch January 10, 2024 12:18
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