fix(core): Fix pruning of non-finished executions (#7333)

This fixes a bug in the pruning (soft-delete). The pruning was a bit too
aggressive, as it also pruned executions that weren't in an end state
yet. This only becomes an issue if there are long-running executions
(e.g. workflow with Wait node) or the prune parameters are set to keep
only a tiny number of executions.
This commit is contained in:
Tomi Turtiainen
2023-10-04 16:32:05 +03:00
committed by GitHub
parent 942d0b91fc
commit 1b4848afcb
6 changed files with 251 additions and 92 deletions

View File

@@ -310,7 +310,7 @@ export const schema = {
env: 'EXECUTIONS_DATA_PRUNE',
},
pruneDataMaxAge: {
doc: 'How old (hours) the execution data has to be to get deleted',
doc: 'How old (hours) the finished execution data has to be to get deleted',
format: Number,
default: 336,
env: 'EXECUTIONS_DATA_MAX_AGE',
@@ -320,7 +320,7 @@ export const schema = {
// Deletes the oldest entries first
// Set to 0 for No limit
pruneDataMaxCount: {
doc: 'Maximum number of executions to keep in DB. 0 = no limit',
doc: "Maximum number of finished executions to keep in DB. Doesn't necessarily prune exactly to max number. 0 = no limit",
format: Number,
default: 10000,
env: 'EXECUTIONS_DATA_PRUNE_MAX_COUNT',