Running the BART WAL Scanner v2.6

Use the BART WAL scanner to invoke the bart-scanner program located in the BART_HOME/bin directory. When invoking the WAL scanner, the current user must be the BART user account.

Syntax:

bart-scanner
  [ -d ]
  [ -c <config_file_path> ]
  { –h |
    -v |
    --daemon |
    -p <mbm_file_path> |
    <wal_file_path> |
    RELOAD |
    STOP
    --checksum-algorithm }
Note

For clarity, the syntax diagram shows only the single-character option form (for example, -d), but the multi-character option form (for example, --debug) is supported as well.

The WAL scanner processes each WAL file to find and record modified blocks in a corresponding modified block map (MBM) file. The default approach is that the WAL scanner gets notified whenever a new WAL file is added to the archived_wals directory specified in the archive_path parameter of the configuration file. It then scans the WAL file and produces the MBM file.

The default approach does not work in some cases; for example when the WAL files are shipped to the archive_path using the Network File System (NFS) and also in case of some specific platforms. This results in the WAL files being copied to the archived_wals directory, but the WAL scanner does not scan them (as WAL scanner is not aware of WAL file) and produce the MBM files. This results in the failure of an incremental backup. This can be avoided by using the timer-based WAL scanning approach, which is done by using the scan_interval parameter in the BART configuration file. The value for scan_interval is the number of seconds after which the WAL scanner will initiate force scanning of the new WAL files. See the EDB Backup and Recovery Installation and Upgrade Guide available at the EDB website for more information about scan_interval parameter.

Note

After upgrading to BART 2.6, users who have set this parameter to a non-default value may see increased CPU consumption on the part of bart-scanner. If this is an issue, consider increasing the configured value of scan_interval parameter, or removing the setting if it is not required.

When the bart-scanner program is invoked, it forks a separate process for each database server enabled with the allow_incremental_backups parameter.

The WAL scanner processes can run in either the foreground or background depending upon usage of the --daemon option. Use the --daemon option to run the WAL scanner process in the background so that all output messages can be viewed in the BART log file. If the --daemon option is omitted, the WAL scanner process runs in the foreground and all output messages can be viewed from the terminal running the program as well as in the BART log file.

See the EDB Backup and Recovery Installation and Upgrade Guide available at the EDB website for additional information about WAL scanning, allow_incremental_backups, and logfile parameters.

Note

The BART user account’s LD_LIBRARY_PATH environment variable may need to be set to include the directory containing the libpq library if invocation of the WAL scanner program fails. See Basic BART Subcommand Usage for information about setting the LD_LIBRARY_PATH environment variable.

The following table describes the scanner options:

OptionsDescription
-h --helpDisplays general syntax and information on WAL scanner usage.
-v --versionDisplays the WAL scanner version information.
-d --debugDisplays debugging output while executing the WAL scanner with any of its options.
-c <config_file_path> --config-path <config_file_path>Use this option to specify the config_file_path of a BART configuration file if you do not want to use the default BART configuration file path BART_HOME/etc/bart.cfg.
--daemonRuns the WAL scanner as a background process.
-p <mbm_file_path> --print <mbm_file_path>Use this option to specify the full directory path to an MBM file whose content is to be printed. The directory specified in the archive_path parameter in the bart.cfg file contains the MBM files.
<wal_file_path>Specify the full directory path to a WAL file to be scanned. The directory specified in the archive_path parameter in the bart.cfg file contains the WAL files. Use this option if a WAL file in the archive path is missing its MBM file. This option is to be used for assisting the EnterpriseDB support team for debugging problems that may have been encountered.
RELOADReloads the BART configuration file. The keyword RELOAD is not case-sensitive. The RELOAD option is useful if you make changes to the configuration file after the WAL scanner has been started. It will reload the configuration file and adjust the WAL scanners accordingly. For example, if a server section allowing incremental backups is removed from the BART configuration file, then the process attached to that server will stop. Similarly, if a server allowing incremental backups is added, a new WAL scanner process will be launched to scan the WAL files of that server.
STOPStops the WAL scanner. The keyword STOP is not case-sensitive.
--checksum-algorithmWhile invoking the WAL scanner, you can specify one of the following values with the --checksum-algorithm option: --checksum-algorithm=MD5 (default) to generate MD5 checksum files. --checksum-algorithm=SHA256 to generate SHA256 checksum files. --checksum-algorithm=NONE to skip generating checksum files.