ashb commented on a change in pull request #9067: URL: https://github.com/apache/airflow/pull/9067#discussion_r450138016
########## File path: UPDATING.md ########## @@ -61,6 +61,14 @@ More tips can be found in the guide: https://developers.google.com/style/inclusive-documentation --> +### Unique conn_id Review comment: ```suggestion ### Connections must now have a unique conn_id ``` ########## File path: UPDATING.md ########## @@ -61,6 +61,14 @@ More tips can be found in the guide: https://developers.google.com/style/inclusive-documentation --> +### Unique conn_id + +Previously, airflow allowed users to add more than one connection with the same ``conn_id`` and on access it would choose one connection randomly. This acted as a basic load balancing and fault tolerance technique, when used in conjunction with retries. Review comment: ```suggestion Previously, Airflow allowed users to add more than one connection with the same `conn_id` and on access it would choose one connection randomly. This acted as a basic load balancing and fault tolerance technique, when used in conjunction with retries. ``` ########## File path: airflow/models/connection.py ########## @@ -145,7 +145,7 @@ class Connection(Base, LoggingMixin): __tablename__ = "connection" id = Column(Integer(), primary_key=True) - conn_id = Column(String(ID_LEN)) + conn_id = Column(String(ID_LEN), unique=True) Review comment: ```suggestion conn_id = Column(String(ID_LEN), unique=True, nullable=False) ``` ########## File path: UPDATING.md ########## @@ -61,6 +61,14 @@ More tips can be found in the guide: https://developers.google.com/style/inclusive-documentation --> +### Unique conn_id + +Previously, airflow allowed users to add more than one connection with the same ``conn_id`` and on access it would choose one connection randomly. This acted as a basic load balancing and fault tolerance technique, when used in conjunction with retries. + +This behavior caused some confusion for users, and there was no clear evidence if it actually worked well or not. + +Now the ``conn_id`` will be unique. New users will not have to deal with any consequences. But for existing users that already have data in their metadata database, they will have to manage those duplicate connections before upgrading the database with ``airflow db upgrade``. Review comment: ```suggestion Now the `conn_id` will be unique. New users will not have to deal with any consequences. But for existing users that already have data in their metadata database, they will have to manage those duplicate connections before upgrading the database with `airflow db upgrade`. ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
