Cleans up deleted nodes and dangling transactions that are old enough.
Schedule cleanup
You can schedule or manually trigger the nodeServiceCleanupTrigger script to clean up deleted nodes, dangling
transactions, and property values tables (i.e. alf_transaction, alf_node and alf_node_properties tables).
The nodeServiceCleanupTrigger is a MonitoredCronTrigger script, and a schedule to run this script can be set in the
alfresco-global.properties file or by using JMX.
To run this script on a schedule, add the following line to the alfresco-global.properties file:
system.nodeServiceCleanup.cronExpression=0 0 21 * * ?
The default setting for this property is a Quartz Cron expression, 0 0 21 * * ?, which runs every day at 9pm.
Alfresco recommends that you don’t change the default value unless required.
Below are the default settings for the V1 cleanup job:
# --Node cleanup batch -default settings
system.node_cleanup.delete_batchSize=1000
system.node_table_cleaner.algorithm=V1
index.tracking.minRecordPurgeAgeDays=30
index.tracking.purgeSize=7200000
Using the V2 algorithm
The V2 algorithm is designed to operate at scale by deleting items in batches of configurable size. Currently, the V2 algorithm is supported only by PostgreSQL.
Change the node cleanup batch default properties in alfresco-global.properties:
-
Enable the new cleanup algorithm:
system.node_table_cleaner.algorithm=V2 -
Set the batch size. This property defines the number of items deleted in one prepared delete statement:
system.node_cleanup.delete_batchSize=1000 -
Set the tracking purge size. This property specifies the size of the chunk (in millisec). Default is a couple of hours. This property is not relevant for the V2 algorithm:
index.tracking.purgeSize=7200000 -
Set the minimum age (in days) before nodes and transactions get purged:
index.tracking.minRecordPurgeAgeDays=30