Skip to content

Correctly pre-allocate external_executor_id. with multiple executors.#67388

Open
ashb wants to merge 1 commit into
mainfrom
fix-postgres-celery-multi-exec-uuid
Open

Correctly pre-allocate external_executor_id. with multiple executors.#67388
ashb wants to merge 1 commit into
mainfrom
fix-postgres-celery-multi-exec-uuid

Conversation

@ashb
Copy link
Copy Markdown
Member

@ashb ashb commented May 23, 2026

This wasn't working on PostgreSQL when you used CeleryExecutor with another
executor as the arms of the CASE had different types:

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DatatypeMismatch) CASE types text and uuid cannot be matched

The fix is to use an explicit cast. Reported by @jscheffl in slack and in #67385

closes: #67385


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

This wasn't working on PostgreSQL when you used CeleryExecutor with another
executor as the arms of the CASE had different types:

```
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DatatypeMismatch) CASE types text and uuid cannot be matched
```

The fix is to use an explicit cast.
@ashb ashb requested a review from XD-DENG as a code owner May 23, 2026 20:38
@boring-cyborg boring-cyborg Bot added the area:Scheduler including HA (high availability) scheduler label May 23, 2026
@ashb ashb added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 23, 2026
@ashb ashb added this to the Airflow 3.2.2 milestone May 23, 2026
@kaxil kaxil changed the title Correctly pre-allocate external_exeuctor_id with multiple executors. Correctly pre-allocate external_executor_id. with multiple executors. May 23, 2026
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Pure code-reading looks good. Unfortunately I am OOO but carry my business laptop with me and attempt to repro with this patched... but can not promise tomorrow. But code looks as promising that I assume "looks good" w/o testing in our env.

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

Labels

area:Scheduler including HA (high availability) scheduler backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler fails in setting external executor if multiple executors in use

4 participants