kaxil commented on issue #63551:
URL: https://github.com/apache/airflow/issues/63551#issuecomment-4058452684

   This doesn't appear to be a valid bug. The `default_pool` is created in all 
standard code paths — both on 3.1.8 and main.
   
   **On 3.1.8 specifically**, `upgradedb()` has an unconditional fresh-DB check 
with no `to_revision` guard — every fresh database hits `initdb()` and returns:
   
   
https://github.com/apache/airflow/blob/3.1.8/airflow-core/src/airflow/utils/db.py#L1122-L1126
   
   `initdb()` then calls `add_default_pool_if_not_exists()`:
   
   
https://github.com/apache/airflow/blob/3.1.8/airflow-core/src/airflow/utils/db.py#L753-L755
   
   For existing databases, `add_default_pool_if_not_exists()` is also called 
after the Alembic migration completes:
   
   
https://github.com/apache/airflow/blob/3.1.8/airflow-core/src/airflow/utils/db.py#L1153-L1154
   
   **On main**, the same coverage exists. Fresh DB without `--to-revision` goes 
through `initdb()`:
   
   
https://github.com/apache/airflow/blob/a9a9c5a57fbaaa11499967b39bac11adedea857e/airflow-core/src/airflow/utils/db.py#L1243-L1246
   
   All other paths go through `_run_upgradedb()` which calls 
`add_default_pool_if_not_exists()` unconditionally:
   
   
https://github.com/apache/airflow/blob/a9a9c5a57fbaaa11499967b39bac11adedea857e/airflow-core/src/airflow/utils/db.py#L1181-L1182
   
   **Additional safety nets:**
   - The squashed migration inserts `default_pool` via `bulk_insert`:
   
   
https://github.com/apache/airflow/blob/3.1.8/airflow-core/src/airflow/migrations/versions/0000_2_6_2_squashed_migrations.py#L756-L772
   
   - `Pool.delete_pool()` prevents deletion of `default_pool`:
   
   
https://github.com/apache/airflow/blob/3.1.8/airflow-core/src/airflow/models/pool.py#L151-L154
   
   Every standard deployment path — including the Helm chart (`values.yaml` 
runs `airflow db migrate`) — creates the `default_pool`. The only way it could 
be missing is direct SQL manipulation of the database.
   
   Could you share the exact commands you ran and the full logs from `airflow 
db migrate`? That would help confirm whether something unusual happened in your 
environment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to