-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(engine): cleanup orphaned job timeouts and backoffs on migration
After an update from a previous version, both backoff and deadline column families might contain entries without a corresponding job or multiple entries for a single job. Before fixing #12797 and #13041, these were cleaned up ad-hoc whenever they were found. This is no longer the case because we now prevent the creation of duplicated entries and always cleanup properly. This adds two necessary migrations that remove orphaned entries that were left by a previous version. The migrations run once and walk through all deadline and backoff entries, removing those without a job and duplicates which don't match the current job state. (cherry picked from commit 1d82e6e)
- Loading branch information
1 parent
f8accc3
commit 6bd5819
Showing
5 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
engine/src/main/java/io/camunda/zeebe/engine/state/migration/JobBackoffCleanup.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.engine.state.migration; | ||
|
||
import io.camunda.zeebe.engine.state.mutable.MutableProcessingState; | ||
|
||
public class JobBackoffCleanup implements MigrationTask { | ||
|
||
@Override | ||
public String getIdentifier() { | ||
return getClass().getSimpleName(); | ||
} | ||
|
||
@Override | ||
public void runMigration(final MutableProcessingState processingState) { | ||
processingState.getJobState().cleanupBackoffsWithoutJobs(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
engine/src/main/java/io/camunda/zeebe/engine/state/migration/JobTimeoutCleanup.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.engine.state.migration; | ||
|
||
import io.camunda.zeebe.engine.state.mutable.MutableProcessingState; | ||
|
||
public class JobTimeoutCleanup implements MigrationTask { | ||
|
||
@Override | ||
public String getIdentifier() { | ||
return getClass().getSimpleName(); | ||
} | ||
|
||
@Override | ||
public void runMigration(final MutableProcessingState processingState) { | ||
processingState.getJobState().cleanupTimeoutsWithoutJob(); | ||
} | ||
} |
This file contains 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