Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(restore): rework progress aggregation (#4225)
* refactor(schema): remove unused restore_run_progress skipped column 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. * feat(schema): add restore_run_progress restored column 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. * feat(restore): adjust Rclone and l&s restore progress update 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. * refactor(restore): separate progress aggregation from DB query 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. * feat(restore): fill HostProgress RestoredBytes/Duration Followup to the e112747. * feat(restore): allow for specifying now in progress aggregation It is important to specify now when testing. * feat(restore): add unit tests for progress aggregation Thanks to the previous commit, it is now possible to add unit tests for progress aggregation!
- Loading branch information