Taragolis commented on code in PR #38040:
URL: https://github.com/apache/airflow/pull/38040#discussion_r1520544589


##########
airflow/providers/google/cloud/transfers/postgres_to_gcs.py:
##########
@@ -112,7 +112,13 @@ def __init__(
         self.cursor_itersize = cursor_itersize
 
     def _unique_name(self):
-        return f"{self.dag_id}__{self.task_id}__{uuid.uuid4()}" if 
self.use_server_side_cursor else None
+        """
+        Generates a deterministic UUID for the cursor name,
+        using the combination of DAG ID and task ID.
+        """
+        if self.use_server_side_cursor:
+            return str(uuid5(uuid5(NAMESPACE_OID, self.dag_id), self.task_id))

Review Comment:
   dag_id abd task_id might be useful for some monitoring tools around postgres 
for better identify, uuid4 here just for some uniqueness.  
   
   I'm feeling not good about uuid1 because it expose MAC address, which might 
not be so bad in this situation.
   
   uuid7 still in draft, or at least it not supported in current version of 
Python, I'm not check it status for couple years.
   
   But yeah it could be any random/random-like/time-based staff which fit into 
the 63 bytes, it is really small chance that someone recompile postgres with 
reduce allowed size of all identifiers.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to