Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup output for tasks in terminal states
PR Shopify#1133 changed how Tasks store their output. Previously, output chunks were store to a table in the RDBMS of the host application. Now, the application's Redis store houses these "output chunks". Periodically shipit-engine will attempt to consolidate these "output chunks" into a gzipped record of the "output" into the Task's table. Our shipit-engine's Redis volume recently reached 100% capacity - bringing CD service down. We observed that the majority of the volume was consumed by un-"rolled up" task logs. We were able to manually cleanup these orphaned output chunks and restore service. The cron task only schedules ChunkRollupJobs for a subset of "finished" tasks - `error`, `failed`, `aborted`, etc tasks will never "rollup" their log output and eventually fill the Redis data store with task output logs. When output chunks were stored in the RDBMS it was probably OK that these records remained in the output_chunks table, but since critical services of shipit-engine - namely Sidekiq - rely on a functioning Redis instance - leaving these records in Redis seems harmful. This changes the "status" check of the `due_for_rollup` scope to include all terminal statuses. References ---------- - Shopify#1133
- Loading branch information