Skip to content

Commit b109600

Browse files
authored
Merge pull request #1332 from datanav/IS-17887
docs: $retract DTL flag for history pruning (IS-17887)
2 parents fdafe2f + 3c17974 commit b109600

4 files changed

Lines changed: 50 additions & 1 deletion

File tree

hub/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
.. _changelog_2026-04-07:
5+
6+
2026-04-07
7+
----------
8+
* Added :ref:`compaction.retract <compaction_retract_detail>`. When enabled on a pipe, writing an entity with ``$retract: true`` permanently removes all earlier versions of that entity from the sink dataset.
9+
10+
411
.. _changelog_2026-03-30:
512

613
2026-03-30

hub/documentation/data-management/entity-data-model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ Entity fields starting with ``$`` are semi-reserved. They have special meaning a
173173
the current one.
174174
-
175175

176+
.. _dollar_retract:
177+
* - ``$retract``
178+
- If set to ``true`` and :ref:`compaction.retract <compaction_feature>` is enabled on the pipe,
179+
all previous versions of the entity are permanently removed from the dataset while the current
180+
version is retained. See :ref:`Compaction: Retract <compaction_retract_detail>` for details.
181+
-
182+
176183
.. _entity_data_types:
177184

178185
Standard types

hub/features/compaction-feature.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,37 @@ Properties
101101
times out, the compaction process will continue from where it last stopped the next time the pipe runs.
102102
- 60
103103
- No
104+
105+
* - ``compaction.retract``
106+
- Boolean
107+
- If ``true``, the pipe will honour the :ref:`$retract <dollar_retract>` field on output entities.
108+
When an entity with ``$retract: true`` is written to the sink dataset, all earlier versions of that
109+
entity are permanently removed while the current version is retained.
110+
- ``false``
111+
- No
112+
113+
* - ``compaction.retract_timeout_seconds``
114+
- Number
115+
- Determines the number of seconds that the pipe is allowed to spend on the retraction process. If the pipe
116+
times out, the retraction process will continue from where it last stopped the next time the pipe runs.
117+
- 60
118+
- No
119+
120+
.. _compaction_retract_detail:
121+
122+
Retract
123+
^^^^^^^
124+
125+
When ``compaction.retract`` is enabled and an output entity has ``$retract: true``, all earlier
126+
versions of that entity are permanently removed from the sink dataset while the current version
127+
is retained. Deletion state is unaffected. The operation is idempotent.
128+
129+
.. WARNING::
130+
131+
Retract is irreversible. Pruned versions cannot be recovered. Enabling retract will override the
132+
``compaction.keep_versions`` setting on a per-entity basis.
133+
134+
- Only the pipe's sink dataset is affected. Upstream datasets and external consumers are unchanged.
135+
- ``$retract`` propagates like any other field but may be dropped by :ref:`merge sources <merge_source>`
136+
or :ref:`emit_children <emit_children_transform>`. Downstream pipes that must honour the retract
137+
need ``compaction.retract`` enabled and ``$retract`` explicitly included in their output.

hub/quick-reference.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,5 @@ Entity model
337337
* - Special fields
338338
- :ref:`$children <dollar_children>` ·
339339
:ref:`$ids <dollar_ids_field>` ·
340-
:ref:`$replaced <dollar_replaced>`
340+
:ref:`$replaced <dollar_replaced>` ·
341+
:ref:`$retract <dollar_retract>`

0 commit comments

Comments
 (0)