Skip to content

Gracefully stop compaction tasks after a maximum age #6818

@patchwork01

Description

@patchwork01

User Story

As a user redeploying an instance of Sleeper to apply an upgrade, I want running compaction tasks to be replaced with tasks running the new version, so that any upgrades will be applied for all compaction jobs after some period.

Description / Background

Under epic:

Under parent issue:

In normal operation of a Sleeper instance, compaction tasks may run indefinitely, as new compaction jobs continue to be created.

We'd like to add a limit on the lifetime of a compaction task, so that any tasks running an old version of the code will gracefully terminate and be replaced with a new task running the new version.

This can also apply when no upgrades are applied to the instance, as part of normal operation.

Acceptance Criteria

Given I redeploy an instance of Sleeper to upgrade to a new version
When I wait for the configured maximum lifetime of a compaction task
And I wait for any running compaction jobs on old tasks to finish
Then all compaction tasks running the old version should terminate
And new compaction tasks will be created as usual

Technical Notes / Implementation Details

The behaviour for when a compaction task will terminate is in the class CompactionTask, tested in CompactionTaskTerminateTest, and other unit test classes next to it.

We can check for whether the maximum lifetime has been met after we finish a job, and before we move onto the next.

We can add an instance property for the maximum lifetime of compaction tasks.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions