fix(caldav): automatically delete outdated scheduling objects#45235
Merged
miaulalala merged 1 commit intomasterfrom Jun 3, 2024
Merged
fix(caldav): automatically delete outdated scheduling objects#45235miaulalala merged 1 commit intomasterfrom
miaulalala merged 1 commit intomasterfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
tcitworld
reviewed
May 14, 2024
This comment was marked as outdated.
This comment was marked as outdated.
cbcae93 to
f2d7e9f
Compare
Member
ChristophWurst
left a comment
There was a problem hiding this comment.
Let's get rid of the hourly full table scan
👍 otherwise
kesselb
reviewed
May 28, 2024
kesselb
approved these changes
May 28, 2024
ChristophWurst
approved these changes
May 28, 2024
| ITimeFactory $timeFactory, | ||
| ) { | ||
| parent::__construct($timeFactory); | ||
| $this->setInterval(23 * 60 * 60); |
Member
There was a problem hiding this comment.
it would move back all the time, as the run time is not 0 seconds and it can be started with up to 14 minutes delay.
That would mean it would fall further back and back in the "maintenance time window" and eventually skip some day as current time + 24h is outside of maintenance window.
With 23h it will just be saver to run every day.
1a53766 to
6ba43b3
Compare
Contributor
Author
|
/backport to stable29 |
Contributor
Author
|
/backport to stable28 |
Contributor
Author
|
/backport to stable27 |
kesselb
reviewed
May 28, 2024
Signed-off-by: Anna Larch <anna@nextcloud.com>
6ba43b3 to
ad78f7e
Compare
Merged
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
oc_schedulingobjectsvia cron #43621Summary
oc_schedulingobjects currently grows without ever deleting outdated objects. This PR a repair step that is declared as expensive so admins can decide to run them at their convenience for the initial delete.
The delete is chunked to 50k rows on each transaction so the database isn't locked for a long time (especially in clustered setups this could cause issues). MySQL needs special treatment as it doesn't support LIMITs on DELETE queries, so it does a SELECT on the ids to delete, and then runs the delete on those.
After the repair step has run, a regular cron job is added to the Jobs List that runs every hour to get rid of scheduling objects that are older than an hour. We don't really need them and could theoretically delete them as soon as they're processed by the
ITip\Brokerbut as rooms and resources are also run in a cron job, keeping them until the principal room and resources are added is probably a good idea as I can't exclude unwanted side effects. I also updated the runtime for rooms and resources to run every half hour for that reason.Checklist