Component Version Cleanup

Component versions are automatically cleaned up, or deleted, based on rules that you define in System Settings.

The cleanup procedure runs every 24 hours. The hour at which this procedure is run is specified in the Hour to Clean Versions parameter.

The following parameters are used to determine whether versions should be kept.

There are multiple levels at which the parameters may be set. They are evaluated in ascending order of priority.

  1. System level.  Settings  for  those parameters can be found in System Settings. Allowed values for both of the parameters are “-1” or “integer greater then 0”.
  2. Component level.  Settings  for  those parameters can be found when you edit a component. To enable them you should clear the Inherit Cleanup Settings checkbox. Allowed values for both of the parameters are “-1”, “0”, or “integer greater then 0”.
  3. Environment level.   Settings  for  those parameters can be found when you edit an environment at the application level. To enable them you should uncheck the Inherit Cleanup Settings checkbox. Allowed values for both of the parameters are “-1”, “0”, or “integer greater then 0”.

Environment and component level settings are deselected by default for each component and environment.

The cleanup procedure starts with retrieving all components from the database and looping through their versions in descending order. Every version is evaluated as follows:

  1. What values of Days to Keep Versions and Number of Versions to Keep should be used for this version?
    1. Initial parameter values are set to be equal to system level values.
    2. If the component overrides at least one of these values with a non-zero value,  use both of them from the component level instead.
    3. Get a list of environments that ever had this version used in a process request.
    4. Iterate them sequentially. If an environment has cleanup parameters overridden, use the following criteria:
      1. For Days to Keep Versions parameter, extend, if needed, the amount of days to the environment level value.
      2. For Number of Versions to Keep, save the environment level value for later use.
  2. Sequentially check this version against the set of rules. If a rule indicates the version should be kept, the version is not deleted.
    1. If either Days to Keep Versions and Number of Versions to Keep  is set to “-1”, keep this version.
    2. If both Days to Keep Versions and Number of Versions to Keep  is set to “0”, keep this version.
    3. If this version fits the “days to keep version” rule, in that the specified amount of days has not yet passed, keep this version.
    4. If this version fits the “number of versions to keep” rule, in that the version index is less then specified number of versions to keep, keep this version.
    5. If this version has active inventory, keep this version.
    6. If this version fits the “number of versions to keep” on some environment as determined in the previous pass, in that the version index is less than the specified number of versions to keep for this environment, keep this version.

Related Topics

System Settings