You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jarek Potiuk (Jira)" <ji...@apache.org> on 2019/09/11 18:59:00 UTC

[jira] [Commented] (AIRFLOW-5460) Why does airlfow allow multiple connections with the same connection id?

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

Jarek Potiuk commented on AIRFLOW-5460:
---------------------------------------

Yep it is a feature and I thought it is well described. I was quite happy to find that it is there :) the use case is quite reasonable.- when you have databases with multiple slaves or multi-master setup you can specify connections to all instances and you got load balancing without having to implement proxy (which makes it much better distributed as the distribution of traffic is dono without going through any intermediary layer).

 This is quite typical pattern I was used to from telecommunication world so I was not too surprised when I found out Airflow uses it.

> Why does airlfow allow multiple connections with the same connection id?
> ------------------------------------------------------------------------
>
>                 Key: AIRFLOW-5460
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5460
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.5
>            Reporter: Nikolas Vanderhoof
>            Priority: Major
>
> I tagged the issue as a Bug, but it's probably a feature that I just don't understand the reasoning behind. 
> I was working on creating a custom hook in airflow. I would expect that get_connection from BaseHook would return deterministically. To my surprise, it returns a randomly chosen connection from all connections with the given connection id. 
> My gut reaction to this: it seems like a bad design choice to allow users to specify multiple connections with the same id. If there is a compelling reason for allowing this, I would like to understand it, and at least broadcast that connections can share ids in the documentation so other users are not as surprised by the feature. 
> Not sure who to tag on this, please forgive any mis-tagging here. :)
> [~maxime.beauchemin@apache.org] [~kaxilnaik] [~higrys] [~ash] [~Fokko]



--
This message was sent by Atlassian Jira
(v8.3.2#803003)