]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/RELEASE_NOTES_NEXT/Administration/purge-at-events.adoc
87e5fbe16c879a726ed1bc8af9008728f864189e
[Evergreen.git] / docs / RELEASE_NOTES_NEXT / Administration / purge-at-events.adoc
1 Action/Trigger Events Data Purging
2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
4 Action/Trigger event definitions have a new field called "Retention 
5 Interval".  When an optional interval value is applied, events and
6 template output data linked to the event definition will be deleted
7 from the database once they reach the specified age.
8
9 Retention Interval Restrictions for Passive Hooks
10 +++++++++++++++++++++++++++++++++++++++++++++++++
11
12 Restrictions are placed on retention interval values for event definitions
13 using passive hooks to prevent data from being deleted while it's still
14 needed by the system.
15
16 The presence of event data is how the system knows not to send duplicate
17 events.  As long as a scenario exists where a duplicate event may be
18 generated, the events must be retained.
19
20 To apply a retention interval value to a passive-hook event definition:
21
22  * The event definition must have a max_delay value.
23  * The retention interval must be larger than the difference between
24    the delay and max_delay values.
25
26 For example, if the delay is 7 days and max_delay is 10 days, the retention
27 interval must be greater than 3 days to ensure no duplicate events are 
28 created between the first event on day 7 and the end of the event validity
29 window on day 10.
30
31 Deployment
32 ++++++++++
33
34 A new purge_at_events.sh script is installed in the bin directory
35 (typically /openils/bin) wich should be added to CRON for regular
36 maintanence.
37
38 NOTE: On large data sets, this script can take a long time to run and
39 create higher than normal I/O load as it churns though the event and
40 event_output tables.  You may wish to run the script by hand the first
41 time so it can be monitored.  It can be run in psql like so:
42
43 [source,sql]
44 ---------------------------------------------------------------
45 SELECT action_trigger.purge_events();
46 ---------------------------------------------------------------
47
48 NOTE: On *very* large data sets (10s to 100s of millions of event and
49 event_output rows), it may be advisable to first to repopulate the event
50 and event_output tables with only the desired data before starting
51 regular purges.  This can be done, for example, using the copy to temp
52 table, truncate source table, repopulate source table from temp table
53 approach.  This will be much faster than the purge_events() function
54 in cases where most of the data will be purged.
55
56 Hook Data Cleanup
57 +++++++++++++++++
58
59 A number of action_trigger.hook entries which have always been treated
60 as active hooks, though are configured as passive hooks, have been 
61 updated to properly reflect the non-passive-ness.  This allows for 
62 simpler configuration of their retention interval values.
63