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

Restore: rely on run.units instead of target.keyspace #4040

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

Michal-Leszczynski
Copy link
Collaborator

@Michal-Leszczynski Michal-Leszczynski commented Sep 23, 2024

Target.keyspace is calculated at the beginning of each restore task run.
It is vulnerable for changes occurring during restore process, e.g.:

  • restore targeting some views is started
  • target.keyspace excludes restored views (checked via CQL query)
  • restore is paused
  • restore is resumed
  • recalculated target.keyspace no longer excludes restored views

Units are calculated only once at the beginning of the restore,
so they are not vulnerable to mentioned changes and should
be used to determine which tables should be restored.

Fixes #4037

…ting over manifests

Target.keyspace is calculated at the beginning of each restore task run.
It is vulnerable for changes occurring during restore process, e.g.:
- restore targeting some views is started
- target.keyspace excludes restored views (checked via CQL query)
- restore is paused
- restore is resumed
- recalculated target.keyspace no longer excludes restored views

Units are calculated only once at the beginning of the restore,
so they are not vulnerable to mentioned changes and should
be used to determine which tables should be restored.

Fixes #4037
@Michal-Leszczynski
Copy link
Collaborator Author

@karol-kokoszka This PR is ready for review!

@Michal-Leszczynski
Copy link
Collaborator Author

@karol-kokoszka Could you take a look?

Copy link
Collaborator

@karol-kokoszka karol-kokoszka left a comment

Choose a reason for hiding this comment

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

Just a few questions.

pkg/service/restore/restore_integration_test.go Outdated Show resolved Hide resolved
pkg/service/restore/model.go Show resolved Hide resolved
@Michal-Leszczynski
Copy link
Collaborator Author

@karol-kokoszka The first round of comments has been addressed!

This commit adds runPausedRestore function which allows to run
restore which is going to be interrupted every specified interval.
Pausing after some arbitrary amount of time might seem flaky,
but we can't always rely on scyllaclient hooks for pausing restore,
as we are biased to where we put them.

This commit also alters runPausedRestore to include views in schema
and the backup, so that it can test for #4037.
Copy link
Collaborator

@karol-kokoszka karol-kokoszka left a comment

Choose a reason for hiding this comment

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

👍 thanks !

@Michal-Leszczynski Michal-Leszczynski merged commit 6d27036 into master Sep 26, 2024
51 checks passed
@Michal-Leszczynski Michal-Leszczynski deleted the ml/fix-4037 branch September 26, 2024 14:24
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.

Interrupting restore targeting view tables is broken
2 participants