Uh oh!
There was an error while loading. Please reload this page.
fix(caldav): automatically delete outdated scheduling objects - #45235
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cbcae93 to
f2d7e9fCompare
ChristophWurst
left a comment
There was a problem hiding this comment.
Let's get rid of the hourly full table scan
👍 otherwise
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| ->from('schedulingobjects') | ||
| ->where($query->expr()->lt('lastmodified', $query->createNamedParameter($modifiedBefore))) | ||
| ->setMaxResults($limit); | ||
| $result = $query->executeQuery(); |
Check notice
Code scanning / Psalm
MoreSpecificImplementedParamType
Uh oh!
There was an error while loading. Please reload this page.
| ITimeFactory $timeFactory, | ||
| ) { | ||
| parent::__construct($timeFactory); | ||
| $this->setInterval(23 * 60 * 60); |
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
6ba43b3Comparemiaulalala
commented
May 28, 2024
/backport to stable29 |
miaulalala
commented
May 28, 2024
/backport to stable28 |
miaulalala
commented
May 28, 2024
/backport to stable27 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Anna Larch <anna@nextcloud.com>
6ba43b3 to
ad78f7eCompare
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