Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent different workflows starting with the same ID #726

Merged
merged 9 commits into from
Jan 22, 2025

Conversation

qianl15
Copy link
Member

@qianl15 qianl15 commented Jan 21, 2025

This PR addresses issue #725 where duplicate workflow ID breaks the existing workflow. The solution is to check the recorded function name, class name, and config name (if any) before proceeding to start the workflow. If there's any difference, throw a DBOSConflictingWorkflowError with a clear error message.

This PR also checks the recorded input versus the provided input, and the provided queue name versus the original queue name, and print a warning message if they don't match.

@qianl15 qianl15 linked an issue Jan 21, 2025 that may be closed by this pull request
tests/wfqueue.test.ts Show resolved Hide resolved
src/system_database.ts Show resolved Hide resolved
src/system_database.ts Outdated Show resolved Hide resolved
qianl15 and others added 4 commits January 21, 2025 16:43
Co-authored-by: Peter Kraft <peter.kraft@dbos.dev>
Signed-off-by: Qian Li <liqian.cs@gmail.com>
const logger = this.executor!.logger;
try {
// This combination uniquely identifies a message for a given Kafka cluster
const workflowUUID = `kafka-unique-id-${topic}-${partition}-${consumerConfig.groupId}-${message.offset}`
Copy link
Member Author

Choose a reason for hiding this comment

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

@chuck-dbos I added error handling and included consumer group ID in the workflow ID. The test seems to pass now. But maybe you have a better solution for this issue.

Copy link
Member

Choose a reason for hiding this comment

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

This is a good and necessary change. Like Chuck said, we need a better way of generating default consumer group IDs, but that's a separate PR.

@chuck-dbos chuck-dbos merged commit dc133af into main Jan 22, 2025
5 checks passed
@chuck-dbos chuck-dbos deleted the qian/fix-conflict-workflow branch January 22, 2025 13:39
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.

Duplicate WorkflowID breaks durability of existing workflow
4 participants