Skip to content

Add support for running multiple orchestrators at once with sidekiq - #470

Draft
adamruzicka wants to merge 6 commits into
Dynflow:masterfrom
adamruzicka:multi-orchestrator
Draft

Add support for running multiple orchestrators at once with sidekiq#470
adamruzicka wants to merge 6 commits into
Dynflow:masterfrom
adamruzicka:multi-orchestrator

Conversation

@adamruzicka

Copy link
Copy Markdown
Contributor

No description provided.

within a single redis instance.

This relies on having per-orhcestrator-instance queues
`dynflow-orhcestrator:${UUID}`. The orchestrators talk with workers
using the regular queues (like `default`), the workers talk back to
orchestrators using the per-orchestrator-instance queues. Execution
plans are distributed to orhcestrators using round-robin, while ordering
of things within a single execution plan is kept.
Multi-orchestrator setups leave behind a dynflow_orchestrator:<world_id>
Sidekiq queue when an orchestrator dies without a clean shutdown. Sweep
these during startup validity checks, removing any queue whose world id
is not a currently active executor world.
Covers the pieces added for running multiple orchestrators: World#id
being configurable, executor.prune_orphaned_queues being invoked from
perform_validity_checks, per-orchestrator reply queue detection and
fallback, the Redis lock/drain flow being bypassed once a subqueue is
configured, reply-queue routing in feed_pool, sender-based work_finished
gating, and the drain/startup-complete recovery round trip.
Tests the new per-orchestrator queue feature by spawning two orchestrators
with distinct queue names (dynflow_orchestrator:orch-a and orch-b), one
worker, and verifying that jobs get distributed across both orchestrators
via round-robin scheduling.
orchestrator_queue was only assigned when matching the per-orchestrator
queue pattern, so the global "dynflow_orchestrator" queue case left it
nil and split(':') blew up.
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.

1 participant