5.5 Running the BART WAL Scanner
5 Operation : 5.5 Running the BART WAL Scanner
The BART WAL scanner is used by invoking the bart-scanner program located in the BART_HOME/bin directory.[ -c config_file_path ]-p mbm_file |For clarity, the syntax diagram shows only the single-character form of the option when the multi-character form is supported as well. The Options subsection lists both the single-character and multi-character forms of the options.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 arrives in the archived_wals directory of the BART backup catalog. It then scans the WAL file and produces the MBM file. This approach does not work in some cases, for example when the WAL files are shipped to the BART backup catalog using the rsync utility 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 is not aware of it so it does not scan them 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 (see sections 4.1 and 4.2.5). The value for scan_interval is the number of seconds after which the WAL scanner will look and scan the new WAL files.When the bart-scanner program is invoked, it forks a separate process for each database server enabled with the allow_incremental_backups parameter. See sections 4.2.5 for information on the allow_incremental_backups parameter.The WAL scanner processes can run in either the foreground or background depending upon usage of the --daemon option:
• If the --daemon option is specified, then the WAL scanner process runs in the background. All output messages can be viewed in the BART log file.When invoking the WAL scanner, the current user must be the BART user account as described in Step 2 of Section 4.1.If the BART_HOME/bin directory is not included in the BART user account’s PATH environment variable, then BART_HOME/bin must be the current working directory when invoking the WAL scanner. The general invocation syntax would appear as follows:cd BART_HOME/bin./bart-scanner optionNote: 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 Section 5.3 for information on setting LD_LIBRARY_PATH.-h, --help-v, --version-d, --debug-c, --config-path config_file_pathSpecifies config_file_path as the full directory path to a BART configuration file. Use this option if you do not want to use the default BART configuration file BART_HOME/etc/bart.cfg.-p, --print mbm_fileFull directory path to an MBM file whose content is to be printed. The archive path directory backup_path/server_name/archived_wals contains the MBM files. Note: This option is to be used for assisting the EnterpriseDB support team for debugging problems that may have been encountered.Full directory path to a WAL file to be scanned. The archive path directory backup_path/server_name/archived_wals contains the WAL files. Use it if a WAL file in the archive path is missing its MBM file.Reload the BART configuration file. The keyword RELOAD is case-insensitive. This 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.Stop the WAL scanner. The keyword STOP is case-insensitive.The following example shows the startup of the WAL scanner to run interactively. The WAL scanner begins scanning existing WAL files in the archive path that have not yet been scanned (that is, there is no corresponding MBM file for the WAL file).The following is the content of the archive path showing the MBM files created for the WAL files. (The user name and group name of the files have been removed from the example to list the WAL files and MBM files in a more observable manner.)To stop the interactively running WAL scanner either enter cntrl-C at the terminal running the WAL scanner or invoke the bart-scanner program from another terminal with the STOP option:The terminal on which the WAL scanner was running interactively now appears as follows after it has been stopped.The following example shows how to invoke the WAL scanner to run as a background process with the --daemon option.The WAL scanner runs as a background process. There is also a separate background process for each database server that has been enabled for WAL scanning with the allow_incremental_backups parameter in the BART configuration file.Should it be necessary to print the content of an MBM file for assisting the EnterpriseDB support team for debugging problems that may have been encountered, use the -p option to specify the file as in the following example:-bash-4.2$ bart-scanner -p /opt/backup/acctg/archived_wals/0000000100000000FF0000280000000100000000.mbm*...................................................................................................*...................................................................................................
5 Operation : 5.5 Running the BART WAL Scanner