-
Notifications
You must be signed in to change notification settings - Fork 35
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: rework progress aggregation #4225
base: master
Are you sure you want to change the base?
Conversation
This column might be interesting for backup which performs deduplication, but it does not make any sense for restore. It wasn't even a part of restore progress API, so it's safe to remove it.
This column wasn't needed with the sync load&stream Scylla API (restored is equal to either 0 or downloaded), but it is cleaner to have it and it can be useful for native restore Scylla API.
Followup to the e112747. In the past we treated RestoredStartedAt/RestoreCompletedAt as the time frame for l&s, but we should look at it more inclusively, so as the time frame of restoring bytes, which for Rclone API + l&s approach starts with the download.
Previously, the code aggregating restore progress and the code querying the run progress for aggregation were tightly tangled. This resulted in difficulties in writing unit tests and a more confusing code overall. This commit changes progress aggregation to use iterator over run progresses, which can be easily mocked in unit tests.
Followup to the e112747.
It is important to specify now when testing.
Thanks to the previous commit, it is now possible to add unit tests for progress aggregation!
eba968f
to
b4cb53d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice usage of iterators and tests!
Thanks @VAveryanov8!
I think that the second is probably better in general, but the first approach seamed more tailored to this PR use case. |
Good question! I don't have a strong opinion on this - iterators are quite new to the language and there are not that many projects that already using them. |
This PR does the following:
iter.Seq
instead of direct DB access, which in turn allows for adding unit tests for progress aggregationRestoredBytes
andRestoreDuration
introduced in Swagger: scylla-manager, move towards just restored bytes #4214Note, the
RestoredBytes
andRestoreDuration
need to be added to thesctool progress
display as a part of a separate PR.