气流-卡在SQL Server中的数据库的启动 [英] Airflow - Initiation of DB stuck in SQL Server

查看:129
本文介绍了气流-卡在SQL Server中的数据库的启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用SQL Server作为后端设置气流,但在 initdb 命令期间陷入困境:

Trying to setup airflow using SQL Server as the backend, but get stuck during the initdb command:

user@computer /my/home> airflow initdb
[2019-09-13 12:10:04,375] {__init__.py:51} INFO - Using executor SequentialExecutor
DB: mssql+pymssql://TestServiceUser:***@my_sql_Server:1433/airflow
[2019-09-13 12:10:05,101] {db.py:369} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl MSSQLImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> e3a246e0dc1, current schema
INFO  [alembic.runtime.migration] Running upgrade e3a246e0dc1 -> 1507a7289a2f, create is_encrypted
INFO  [alembic.runtime.migration] Running upgrade 1507a7289a2f -> 13eb55f81627, maintain history for compatibility with earlier migrations
INFO  [alembic.runtime.migration] Running upgrade 13eb55f81627 -> 338e90f54d61, More logging into task_instance
INFO  [alembic.runtime.migration] Running upgrade 338e90f54d61 -> 52d714495f0, job_id indices
INFO  [alembic.runtime.migration] Running upgrade 52d714495f0 -> 502898887f84, Adding extra to Log
INFO  [alembic.runtime.migration] Running upgrade 502898887f84 -> 1b38cef5b76e, add dagrun
INFO  [alembic.runtime.migration] Running upgrade 1b38cef5b76e -> 2e541a1dcfed, task_duration
INFO  [alembic.runtime.migration] Running upgrade 2e541a1dcfed -> 40e67319e3a9, dagrun_config
INFO  [alembic.runtime.migration] Running upgrade 40e67319e3a9 -> 561833c1c74b, add password column to user
INFO  [alembic.runtime.migration] Running upgrade 561833c1c74b -> 4446e08588, dagrun start end
INFO  [alembic.runtime.migration] Running upgrade 4446e08588 -> bbc73705a13e, Add notification_sent column to sla_miss
INFO  [alembic.runtime.migration] Running upgrade bbc73705a13e -> bba5a7cfc896, Add a column to track the encryption state of the 'Extra' field in connection
INFO  [alembic.runtime.migration] Running upgrade bba5a7cfc896 -> 1968acfc09e3, add is_encrypted column to variable table
INFO  [alembic.runtime.migration] Running upgrade 1968acfc09e3 -> 2e82aab8ef20, rename user table
INFO  [alembic.runtime.migration] Running upgrade 2e82aab8ef20 -> 211e584da130, add TI state index
INFO  [alembic.runtime.migration] Running upgrade 211e584da130 -> 64de9cddf6c9, add task fails journal table
INFO  [alembic.runtime.migration] Running upgrade 64de9cddf6c9 -> f2ca10b85618, add dag_stats table
INFO  [alembic.runtime.migration] Running upgrade f2ca10b85618 -> 4addfa1236f1, Add fractional seconds to mysql tables
INFO  [alembic.runtime.migration] Running upgrade 4addfa1236f1 -> 8504051e801b, xcom dag task indices
INFO  [alembic.runtime.migration] Running upgrade 8504051e801b -> 5e7d17757c7a, add pid field to TaskInstance
INFO  [alembic.runtime.migration] Running upgrade 5e7d17757c7a -> 127d2bf2dfa7, Add dag_id/state index on dag_run table
INFO  [alembic.runtime.migration] Running upgrade 127d2bf2dfa7 -> cc1e65623dc7, add max tries column to task instance

这里它永远挂起。

我查看为此创建的空数据库,并找到创建两个连接的过程,一个正在等待,另一个被另一个锁定:

I look in the empty database created for this reason, and find the process creating two connections, one waiting and one locked by the other:

exec sp_who;

spid    ecid    status  loginame    hostname    blk dbname  cmd request_id
55  0   sleeping    TestServiceUser my_server   airflow AWAITINGCOMMAND 0
56  0   suspended   TestServiceUser my_server   55  airflow EXECUTE 0'

要求SQL Server创建所有阻止的事务报告将返回以下结果:

Asking SQL Server to create an "All Blocking Transactions" report returns the following result:


会话55正在使用SQL语句阻止:-

会话56被阻止完成:

Session 55 is Blocking using SQL statement: -
Session 56 is blocked from completing:

select前1个slot_pool.id为slot_pool_id,

slot_pool.pool为slot_pool_pool,

slot_pool_slots,

slot_pol.description为slot_pool_description,

从slot_pool

,其中slot_pool.slots = 1 AND slot_pool.pool = N'default_pool

select top 1 slot_pool.id as slot_pool_id,
slot_pool.pool as slot_pool_pool,
slot_pool_slots,
slot_pol.description as slot_pool_description,
from slot_pool
where slot_pool.slots = 1 AND slot_pool.pool = N'default_pool

我尝试杀死阻塞连接,但这会导致错误。

I have tried killing the blocking connection, but that results in an error.

我也有尝试使用自动提交和池大小,但无法使其超过最后一行。

I have also tried to play with autocommit and pool sizes, but am unable to make it pass that last line.

任何想法可能会继续阻塞吗?

Any idea what might keep blocking?


  • apache-airflow(1.10.5)

  • Python 3.6.8

  • SQL Server 2016(v13.0.5264.1)

推荐答案

set load_examples = airflow.cfg中的错误

这篇关于气流-卡在SQL Server中的数据库的启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆