This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 9596148620 AIP-64: Document Task Instance History (#40969)
9596148620 is described below
commit 95961486207c3b32c05e6596eb208c87d1cf9d5b
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Tue Jul 23 22:18:47 2024 +0100
AIP-64: Document Task Instance History (#40969)
---
docs/apache-airflow/core-concepts/dag-run.rst | 17 +++++++++++++++--
docs/apache-airflow/img/task_instance_history.png | Bin 0 -> 118727 bytes
docs/apache-airflow/img/task_instance_history_log.png | Bin 0 -> 156398 bytes
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/apache-airflow/core-concepts/dag-run.rst
b/docs/apache-airflow/core-concepts/dag-run.rst
index 02fd30c156..4bfd427158 100644
--- a/docs/apache-airflow/core-concepts/dag-run.rst
+++ b/docs/apache-airflow/core-concepts/dag-run.rst
@@ -163,8 +163,8 @@ Re-run Tasks
------------
Some of the tasks can fail during the scheduled run. Once you have fixed
the errors after going through the logs, you can re-run the tasks by clearing
them for the
-scheduled date. Clearing a task instance doesn't delete the task instance
record.
-Instead, it updates ``max_tries`` to ``0`` and sets the current task instance
state to ``None``, which causes the task to re-run.
+scheduled date. Clearing a task instance creates a record of the task instance.
+The ``try_number`` of the current task instance is incremented, the
``max_tries`` set to ``0`` and the state set to ``None``, which causes the task
to re-run.
Click on the failed task in the Tree or Graph views and then click on
**Clear**.
The executor will re-run it.
@@ -194,6 +194,19 @@ For more options, you can check the help of the `clear
command <../cli-and-env-v
airflow tasks clear --help
+Task Instance History
+---------------------
+When a task instance retries or is cleared, the task instance history is
preserved. You can see this history by clicking on the task instance in the
Grid view.
+
+.. image:: ../img/task_instance_history.png
+
+The history shows the value of the task instance attributes at the end of the
particular run. On the log page, you can also see the logs for each of the task
instance tries.
+This can be useful for debugging.
+
+.. image:: ../img/task_instance_history_log.png
+
+Note that related task instance objects like the XComs, rendered template
fields, etc., are not preserved in the history. Only the task instance
attributes, including the logs, are preserved.
+
External Triggers
'''''''''''''''''
diff --git a/docs/apache-airflow/img/task_instance_history.png
b/docs/apache-airflow/img/task_instance_history.png
new file mode 100644
index 0000000000..d1dcf27a5e
Binary files /dev/null and b/docs/apache-airflow/img/task_instance_history.png
differ
diff --git a/docs/apache-airflow/img/task_instance_history_log.png
b/docs/apache-airflow/img/task_instance_history_log.png
new file mode 100644
index 0000000000..c1d83f3ed3
Binary files /dev/null and
b/docs/apache-airflow/img/task_instance_history_log.png differ