SET_AHM_EPOCH

Sets the Ancient History Mark (AHM) to the specified epoch. This function allows deleted data up to and including the AHM epoch to be purged from physical storage.

SET_AHM_EPOCH is normally used for testing purposes. Instead, consider using SET_AHM_TIME which is easier to use.

Syntax

SET_AHM_EPOCH ( epoch, [ true ]  )

Parameters

epoch

Specifies one of the following:

  • The number of the epoch in which to set the AHM
  • Zero (0) (the default) disables PURGE
true

Allows the AHM to advance when nodes are down.

If the AHM is advanced after the last good epoch of the failed nodes, those nodes must recover all data from scratch. Use with care.

Privileges

Superuser

Restrictions

The number of the specified epoch must be:

  • Greater than the current AHM epoch
  • Less than the current epoch
  • Less than or equal to the cluster last good epoch (the minimum of the last good epochs of the individual nodes in the cluster)

Use the SYSTEM table to see current values of various epochs related to the AHM, For example:

=> SELECT * from SYSTEM;
-[ RECORD 1 ]------------+---------------------------
current_timestamp        | 2009-08-11 17:09:54.651413
current_epoch            | 1512
ahm_epoch                | 961
last_good_epoch          | 1510
refresh_epoch            | -1
designed_fault_tolerance | 1
node_count               | 4
node_down_count          | 0
current_fault_tolerance  | 1
catalog_revision_number  | 1590
wos_used_bytes           | 0
wos_row_count            | 0
ros_used_bytes           | 41490783
ros_row_count            | 1298104
total_used_bytes         | 41490783
total_row_count          | 1298104

All nodes must be up. You cannot use SET_AHM_EPOCH when any node in the cluster is down, except by using the optional true parameter.

When a node is down and you use MAKE_AHM_NOW, the following error is printed to the vertica.log:

Some nodes were excluded from setAHM. If their LGE is before the AHM they will perform full recovery. 

Examples

The following command sets the AHM to a specified epoch of 12:

=> SELECT SET_AHM_EPOCH(12);

The following command sets the AHM to a specified epoch of 2 and allows the AHM to advance despite a failed node:

=> SELECT SET_AHM_EPOCH(2, true);