Actions
Bug #21290
closedsync_past_versions is too slow
Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
-
Release:
Release relationship:
Auto
Description
If a collection has a very large number of past versions (in this case, 2000), operations involving sync_past_versions
(moving, trashing) will time out.
The current implementation loads each record, updates attributes, and saves it back.
We probably want to update the fields directly with SQL UPDATE.
The fields that get synchronized are:
['uuid', 'owner_uuid', 'delete_at', 'trash_at', 'is_trashed', 'replication_desired', 'storage_classes_desired']
Updated by Peter Amstutz 12 months ago
Updated by Peter Amstutz 12 months ago
21290-sync-past-versions @ f7434a49187a0e429b77c45fadcbaa5413434cfc
- All agreed upon points are implemented / addressed.
- yes
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- n/a
- Code is tested and passing, both automated and manual, what manual testing was done is described
- passes tests
- Documentation has been updated.
- n/a
- Behaves appropriately at the intended scale (describe intended scale).
- Should greatly improve performance of operations that require synchronizing changes to old versions of a collection, as this is now a single UPDATE operation instead of loading, updating, and saving each record individually.
- Considered backwards and forwards compatibility issues between client and server.
- n/a
- Follows our coding standards and GUI style guidelines.
- yes
Turns out there's an ActiveRecord method called update_all that does exactly what we want, so this is a very simple fix.
Updated by Peter Amstutz 12 months ago
- Status changed from In Progress to Resolved
Actions