Hyperstage Consistency Manager


How to:

Hyperstage provides a tool to validate Hyperstage-specific metadata structures. The Hyperstage Consistency Manager is an external stand-alone application that can be run against a Hyperstage instance to verify and repair most Hyperstage data structures, including the Knowledge Grid and Data Packs.

If you are seeing unexpected behavior with Hyperstage, such as server crashes, it can help to run the Hyperstage Consistency Manager for information for support and to perform repairs.

Note: Currently, the Hyperstage database must be offline in order to run the Hyperstage Consistency Manager.

Hyperstage Consistency Manager Tests

The Hyperstage Consistency Manager runs tests, as described in the following table.



Delete mask consistency check

Checks that the delete mask headers contain the proper sum for the delete mask body. If any inconsistency is found between the header and body, the Hyperstage Consistency Manager returns the list of blocks of delete mask where inconsistencies were found.

Number of objects in columns equality

Compares the stored number of objects in each column file related to the table. If any inconsistency is found in the number of objects, the Hyperstage Consistency Manager returns the first two columns with different object numbers.

Comparison of maximal value in DIMENSION dictionary versus DPN

Executes only for DIMENSION columns. Compares the maximal key value stored in the DIMENSION column dictionary and in DPNs. If the values differ, the Hyperstage Consistency Manager writes them to the log.

Comparison of number of objects in first-column DPN versus delete mask

Compares the metadata stored in the headers of the delete mask and DPN file related to the number of objects. If any inconsistencies are found, the Hyperstage Consistency Manager returns both numbers. The Hyperstage Consistency Manager compares only the first column because there is an independent test comparing this value between columns. If the test does not find the proper delete mask file or the proper DPN file, the Hyperstage Consistency Manager reports corruption.

Knowledge Grid consistency for column

Checks if the histograms report the proper value of the fixed parameter. A basic test of the Knowledge Node, ensuring the file has a proper format and the type of Knowledge Node corresponds to the column.

Knowledge Grid format for column

Each Knowledge Node is stored in a separate file. This test validates that the header data of each file is in the proper format.

Test for overlapping Data Packs in data files

Checks if there are Data Packs in files that overlap each other. If this situation occurs, the Hyperstage Consistency Manager returns a list of pairs of Data Packs numbers that are overlapping.

Tests of table metadata consistency

Verifies if the table metadata is valid. Includes verification of files used to store items, such as table name, number of columns and their names, types, and constrains like NOT NULL. These are the files created on CREATE TABLE and modified only on ALTER TABLE.

Test of DPNs for non-binary collation

Verifies Data Packs specifically for non-binary collation types (for example: Latin1_swedish.ci). If errors exist, they can be repaired using the Hyperstage Consistency Manager - -repair option.

Syntax: How to Run the Hyperstage Consistency Manager

To view the run options, run Hyperstage Consistency Manager with the - -help flag:

Icm-pure --help

To run Hyperstage Consistency Manager, use the following command:

Icm-pure --datadir=/data_directory_path [parameters]

For example:

  --datadir=C:\HyperstagePG\ib_data --log-file=C:\temp\icm-pure.log

Note: Hyperstage Consistency Manager should be run by the 'postgres' user. It should not be executed by 'root' or any rebuilt knowledge nodes will be owned by root (and cannot be edited), which will result in issues when loading any subsequent data into the 'corrected' tables.

The following table describes the Hyperstage Consistency Manager parameters.



- -help

Displays help message and exit.

-V [ - -version ]

Displays version information and exit.

- -basedir

Absolute path to Hyperstage installation directory.



- -datadir arg

Absolute path to directory. Mandatory.

- -database arg

Name of database chosen for data integrity testing. Optional. If specified, no other databases will be tested.

- -table arg

Name of table chosen for data integrity testing. Optional. If specified, no other tables will be tested.

- -log-file arg

Prints output to log file. Optional. If not specified, the logs will be printed to the console.

-F [ - -full-check ]

Runs full set of tests (may be time-intensive). Running Hyperstage Consistency Manager without the full-check option will result in a quicker test. However, the "Knowledge Grid consistency for column" test will not be run.

- -repair

Repairs found problems.

- -rebuild-kns

Rebuilds the Knowledge Grid. For more information, see About Rebuilding or Repairing Knowledge Nodes.

- -stop-on-error

Stops tests on first error and report.

- -cleanup

In case of an error in the Hyperstage Consistency Manager repair procedure, this option enables Hyperstage Consistency Manager to manually revert the datadir to its previous state. Running Hyperstage Consistency Manager with the - -cleanup option removes the old DPN files (containing incorrect DPNs) from the datadir and also makes the changes performed by Hyperstage Consistency Manager impossible to undo. If the - -cleanup option is not used, the old DPN files remain in the datadir.

About Rebuilding or Repairing Knowledge Nodes

Executing a rebuild of the Knowledge Nodes (using the - -rebuild-kns option) will run the following tests:

  • Test of table metadata consistency
  • Test of Knowledge Grid format for column
  • Test of Knowledge Grid consistency for column

The - -rebuild-kns option will fix any issues found for the first two tests ("Test of table metadata consistency" and "Test of Knowledge Grid format for column").

You can also use the - -repair option along with the - -full-check option to achieve the same results as - -rebuild-kns. Using either of these methods will rebuild any Knowledge Nodes that have been deleted.

About Cleanup Procedures

The Hyperstage Consistency Manager creates backup files when repairing problems related to "Test of DPNs for non-binary collation" (backup files are not created for any other tests). These backup files can be used to revert back to the original data if the Hyperstage Consistency Manager encounters an error during the repair procedure. To revert to the original data, copy or rename the TAXXXXXDPN.icm_bck files to the TAXXXXXDPN.ctb files (found in the ib_data directory).