AlejandroMorgante opened a new pull request, #67524:
URL: https://github.com/apache/airflow/pull/67524

   ## What
   
   Adds `DmsModifyTaskOperator`, `DmsTaskStoppedTrigger`, and a 
`modify_replication_task` hook method to the Amazon provider.
   
   ## Motivation
   
   AWS DMS CDC tasks sometimes lose their binlog position (e.g. after a source 
failover or a long outage). Today there is no way to update a task's table 
mappings or CDC start position from within Airflow — users have to delete and 
recreate the task manually. A dedicated modify operator closes that gap and 
enables fully automated backfill workflows.
   
   ## Why these changes are needed
   
   - `DmsModifyTaskOperator` — wraps `modify_replication_task` and handles the 
full pre-modify lifecycle (stop-if-running, wait-if-modifying, then modify).
   - `DmsTaskStoppedTrigger` — deferrable trigger that waits for a running task 
to reach `stopped` state before the modify is issued, avoiding blocking a 
worker slot.
   - `DmsHook.modify_replication_task` — thin wrapper around the boto3 API, 
serialising dict arguments to JSON.
   
   ## Files changed
   
   | File | Change |
   |---|---|
   | `hooks/dms.py` | Add `modify_replication_task()` |
   | `triggers/dms.py` | Add `DmsTaskStoppedTrigger` |
   | `operators/dms.py` | Add `DmsModifyTaskOperator` (sync + deferrable) |
   | `tests/.../test_dms.py` | 10 new unit tests for the operator |
   | `tests/system/.../example_dms.py` | Add howto snippet |
   | `docs/operators/dms.rst` | Add "Modify a replication task" section |
   
   ## Testing
   
   - All 10 new unit tests pass (`pytest 
providers/amazon/tests/provider_tests/amazon/aws/operators/test_dms.py::TestDmsModifyTaskOperator`).
   - Validated end-to-end against real AWS (us-east-1, `dms.t3.small`): ran a 
DAG that modified `TableMappings` from `original_schema/%` to 
`backfill_schema/specific_table` and back; confirmed via 
`describe-replication-tasks` that the change was applied correctly.
   - `ruff check` passes on all modified Python files.


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