Apache Airflow version
2.2.1
What happened
When a Deferrable Task which is cleared or generated. This Trigger's TriggererId is NULL,and never change, which cause this trigger is never init and run by triggerer process.
What you expected to happen
When a Deferrable Task is generated, It will init and run correctly.
How to reproduce
Clear a Deferrable Task.
I add some log to source code and find out the reason of this problem:

First Query:
is None has a strange behavior, It does not work.
Second Query:
when the trigerer_id has a NULL value in database, it can not query correctly.
I fix both problems by:

Operating System
Ubuntu 16.04
Versions of Apache Airflow Providers
No response
Deployment
Other
Deployment details
1.One Triggerer Process
2. Three Scheduler
3. Pecona Mysql 8.0
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
2.2.1
What happened
When a Deferrable Task which is cleared or generated. This Trigger's TriggererId is NULL,and never change, which cause this trigger is never init and run by triggerer process.
What you expected to happen
When a Deferrable Task is generated, It will init and run correctly.
How to reproduce
Clear a Deferrable Task.

I add some log to source code and find out the reason of this problem:
First Query:
is Nonehas a strange behavior, It does not work.Second Query:
when the trigerer_id has a NULL value in database, it can not query correctly.
I fix both problems by:

Operating System
Ubuntu 16.04
Versions of Apache Airflow Providers
No response
Deployment
Other
Deployment details
1.One Triggerer Process
2. Three Scheduler
3. Pecona Mysql 8.0
Anything else
No response
Are you willing to submit PR?
Code of Conduct