lt_upgrade_check

lt_upgrade_check — A pre-upgrade check tool for lt_upgrade.

Synopsis

lt_upgrade_check -b oldbindir [-B newbindir] -d oldconfigdir -D newconfigdir [option...]

Description

This program is executed before performing the lt_upgrade upgrade. It is used to perform pre-upgrade checks for incompatibilities and anomalies, aiming to minimize the chances of failure during the upgrade process.

The currently supported checks include:

1. Keyword check.

2. Storage space check: The upgrade is only allowed if the available free storage space exceeds the original directory size multiplied by (100 + reserved-space-percent)%. This helps ensure sufficient storage space during the upgrade process. The reserved-space-percent is an optional parameter, which will be further explained below.

Options

lt_upgrade_check accepts the following command-line arguments:

-b bindir
--old-bindir=bindir

the old LightDB executable directory; environment variable LTBINOLD.

-B bindir
--new-bindir=bindir

the new LightDB executable directory; default is the directory where lt_upgrade_check resides; environment variable LTBINNEW.

-d configdir
--old-datadir=configdir

the old database cluster configuration directory; environment variable LTDATAOLD.

-D configdir
--new-datadir=configdir

the new database cluster configuration directory; environment variable LTDATANEW.

-p port
--old-port=port

the old cluster port number; environment variable LTPORTOLD.

-P port
--new-port=port

the new cluster port number; environment variable LTPORTNEW.

-r
--reserved-space-percent

The percentage of remaining disk space. When calculating the required space for the new directory, the rule is to multiply the original directory size by (1 + reserved-space-percent)%. The default value is 20, indicating that the remaining disk space should be greater than the original directory size multiplied by 120%.

-s
--strict

Enables strict mode checking. By default, it is disabled. If this option is enabled, it checks object names such as table names, column names, and function names, and also verifies if any keywords are used in the code of functions, stored procedures, views, and other compiled elements. If this option is not enabled, it only checks for incremental keywords (keywords that are newly added between the old and new database instances). If any keyword is found, it is considered a check failure.

-v
--verbose

Enable detailed internal logging.

-V
--version

Display version information and exit.

-?
--help

Display help information and exit.

Usage

Below is the command to perform a check by invoking lt_upgrade_check on the new database instance:

 new-bindir/lt_upgrade_check -d old-datadir -D new-datadir -b old-bindir -B new-bindir -v -r 50 

This command indicates that during the upgrade from the specified old library database instance to the new library database instance, keyword checking is performed with non-strict enforcement. It requires the remaining disk space to be greater than 150% of the original directory size and prints detailed checking logs.

  • Running lt_upgrade_check

    Prior to running lt_upgrade_check, ensure that both the new and old database instances are on the same server and are in a stopped state. During the check, no one should have access to these instances. By default, the check will run a service on port 50432 to prevent unintended client connections. You can use the same port number for both instances during the check, as the new and old instances will not be running simultaneously.

    The checking process is as follows: After obtaining the keyword information from the new and old database instances, the keyword check is performed first. Then, the storage space check is conducted. Finally, the lt_upgrade --check command is invoked on the new database for further verification.