Skip to content

Re-stamp workflow executor_id when successfully checkpointing a step#462

Open
maxdml wants to merge 1 commit into
mainfrom
restamp-executor-id-on-step-checkpoint
Open

Re-stamp workflow executor_id when successfully checkpointing a step#462
maxdml wants to merge 1 commit into
mainfrom
restamp-executor-id-on-step-checkpoint

Conversation

@maxdml

@maxdml maxdml commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

When an executor "wins" the checkpointing race, it should restamp the executor ID column in the status table so reporting is accurate.

@maxdml
maxdml requested a review from devhawk July 23, 2026 23:22
config.databaseUrl(),
config.dbUser(),
config.dbPassword(),
createDataSource(config.databaseUrl(), config.dbUser(), config.dbPassword()),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devhawk it looks like there might be a pre-existing issue where this path would ignore config.useListenNotify()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean in the else clause? yeah, looks like an issue. If you want to fix it here, go ahead. Otherwise please open an issue

Comment on lines +120 to 133
if (won && executorId != null) {
String updateSql =
"""
UPDATE "%s".workflow_status SET executor_id = ? WHERE workflow_uuid = ? AND executor_id IS DISTINCT FROM ?
"""
.formatted(schema);
try (var stmt = conn.prepareStatement(updateSql)) {
stmt.setString(1, executorId);
stmt.setString(2, result.workflowId());
stmt.setString(3, executorId);
stmt.executeUpdate();
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like it should be a static method on workflowDAO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants