-
Notifications
You must be signed in to change notification settings - Fork 76
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
Move autoremove builds logic to a scheduled job #2468
base: master
Are you sure you want to change the base?
Conversation
it would be good to verify that this doesn't cause any performance degradations on a "production sized" database |
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.
I'll have more code comments later once we agree on the big-picture design.
be7f3ef
to
173e373
Compare
29a9574
to
d14b1f1
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.
Looks good to me once the two comments I left are resolved.
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.
Looks good to me. @zackgalbreath feel free to merge once you've taken a look at the changes I pushed.
Moving this to 3.7 as per our in-person discussion today |
1e6422f
to
c0ed119
Compare
Separate the automatic removal of old builds from CDash's submission parsing logic. Instead, old builds will now be periodically cleaned up as a scheduled job. We use a new, lower priority queue to schedule these pruning jobs so they don't interfere with asychronous submission parsing. This commit moves the remove_builds function (and related helper functions) from common.php to DatabaseCleanupUtils. It also removes the "Cleanup database" from upgrade.php and moves this functionality to a new Artisan command instead: db:cleanup. We use this new db:cleanup command to remove shared records, such as testoutput. This allows us to remove a big chunk of custom logic from our removeBuilds funcion. While writing this commit, the following tables were already handled by db:cleanup: - buildfailuredetails - configure - configureerror - coveragefile - test2image The following tables represent potentially shared data that wasn't already handled by db:cleanup: - note - buildupdate - testoutput - updatefile - image - uploadfile The following tables were found to already have cascade-on-delete foreign keys, and thus their explicit DELETE logic was deemed safe to remove: - build2uploadfile - dynamicanalysisdefect - label2dynamicanalysis - label2buildfailure
c0ed119
to
fc9df9e
Compare
Decouple the cleanup of old builds from the submission parsing step