Adding an ability to cleanup database from stale records.
Prod-Related: PROD-35183
Change-Id: I5676b1ee5a181b18753ae195f0994702f50a3579
diff --git a/README.rst b/README.rst
index 0b41d13..daae157 100644
--- a/README.rst
+++ b/README.rst
@@ -396,3 +396,36 @@
| | operations, verify do not have dead network |
| | agents/compute services) |
+-------------------------------+------------------------------------------------------+
+
+Execute database maintenance tasks
+----------------------------------
+Cleanup stale records from heat database to make it smaller.
+This is helpful before any upgrade activity.
+It is safe to execute it generally without maintenance window same as online db_sync.
+
+Enable this pillar:
+
+.. code-block:: yaml
+
+ heat:
+ server:
+ db_purge:
+ enabled: True
+
+Execute state heat.db.db_cleanup to purge stale records:
+
+.. code-block:: bash
+
+ salt -C 'I@heat:server:role:primary' state.apply heat.db.db_cleanup -l debug
+
+It is possible to pass days parameter.
+If you skip setting it, all records would be archived/purged:
+
+.. code-block:: yaml
+
+ heat:
+ server:
+ db_purge:
+ enabled: True
+ days: 45
+