You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/11/13 22:02:58 UTC

[jira] [Commented] (AIRFLOW-504) datetime.now() has microseconds Mysql does not store these resulting in issues

    [ https://issues.apache.org/jira/browse/AIRFLOW-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15662184#comment-15662184 ] 

ASF subversion and git services commented on AIRFLOW-504:
---------------------------------------------------------

Commit 910c0ddd78d45db1dc613359f3bb1d3ad37bdf74 in incubator-airflow's branch refs/heads/master from [~bolke]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=910c0dd ]

[AIRFLOW-504] Store fractional seconds in MySQL tables

Both utcnow() and now() return fractional seconds. These
are sometimes used in primary_keys (eg. in task_instance).
If MySQL is not configured to store these fractional seconds
a primary key might fail (eg. at session.merge) resulting in
a duplicate entry being added or worse.

Postgres does store fractional seconds if left unconfigured,
sqlite needs to be examined.


> datetime.now() has microseconds Mysql does not store these resulting in issues
> ------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-504
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-504
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Bolke de Bruin
>            Priority: Critical
>
> >>> datetime.datetime.utcnow()
> datetime.datetime(2016, 9, 11, 12, 22, 22, 483998)
> >>> datetime.datetime.now()
> datetime.datetime(2016, 9, 11, 14, 22, 31, 363392)
> >>>
> Mysql rounds those to "2016-05-13 00:00:00". If sqlalchemy now tries to find the the record by primary key (eg. session.merge) it cannot find them due to lost precision.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)