From 6501fcbff322f3a7f72c2aed6b905d581b4ea8ea Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Wed, 6 Dec 2023 14:54:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(mogdb):=E4=BF=AE=E6=94=B9pg=5Fcbm=5Frecycle?= =?UTF-8?q?=5Ffile=E5=87=BD=E6=95=B0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 514 +++++++++--------- ...ackup-and-restoration-control-functions.md | 4 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- ...ackup-and-restoration-control-functions.md | 6 +- 14 files changed, 304 insertions(+), 276 deletions(-) diff --git a/product/en/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index bdada102..692ebcd6 100644 --- a/product/en/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -121,10 +121,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/en/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index bdada102..692ebcd6 100644 --- a/product/en/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -121,10 +121,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/en/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index 2b1c5834..c321efcd 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/en/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index f17e80fe..39d5fbee 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/en/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index f17e80fe..39d5fbee 100644 --- a/product/en/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/en/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md index f17e80fe..446beb17 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md @@ -1,256 +1,258 @@ ---- -title: Backup and Restoration Control Functions -summary: Backup and Restoration Control Functions -author: Zhang Cuiping -date: 2021-04-20 ---- - -# Backup and Restoration Control Functions - -## Backup Control Functions - -Backup control functions help with online backup. - -- pg_create_restore_point(name text) - - Description: Creates a named point for performing the restoration operation (restricted to the system administrator). - - Return type: text - - Note: **pg_create_restore_point** creates a named transaction log record that can be used as a restoration target, and returns the corresponding transaction log location. The given name can then be used with **recovery_target_name** to specify the point up to which restoration will proceed. Avoid creating multiple restoration points with the same name, since restoration will stop at the first one whose name matches the restoration target. - -- pg_current_xlog_location() - - Description: Obtains the write position of the current transaction log. - - Return type: text - - Note: **pg_current_xlog_location** displays the write position of the current transaction log in the same format as those of the previous functions. Read-only operations do not require permissions of the system administrator. - -- pg_current_xlog_insert_location() - - Description: Obtains the insert position of the current transaction log. - - Return type: text - - Note: **pg_current_xlog_insert_location** displays the insert position of the current transaction log. The insertion point is the logical end of the transaction log at any instant, while the write location is the end of what has been written out from the server's internal buffers. The write position is the end that can be detected externally from the server. This operation can be performed to archive only some of completed transaction log files. The insert position is mainly used for commissioning the server. Read-only operations do not require permissions of the system administrator. - -- gs_current_xlog_insert_end_location() - - Description: Obtains the insert position of the current transaction log. - - Return type: text - - Note: **gs_current_xlog_insert_end_location** displays the insert position of the current transaction log. - -- pg_start_backup(label text [, fast boolean ]) - - Description: Starts executing online backup (restricted to the system administrator or replication roles). - - Return type: text - - Note: **pg_start_backup** receives a user-defined backup label (usually the name of the position where the backup dump file is stored). This function writes a backup label file to the data directory of MogDB and then returns the start position of backed up transaction logs in text mode. - - ```sql - MogDB=# SELECT pg_start_backup('label_goes_here'); - pg_start_backup - ----------------- - 0/3000020 - (1 row) - ``` - -- pg_stop_backup() - - Description: Completes online backup (restricted to the system administrator or replication roles). - - Return type: text - - Note: **pg_stop_backup** deletes the label file created by **pg_start_backup** and creates a backup history file in the transaction log archive area. The history file includes the label given to **pg_start_backup**, the start and end transaction log locations for the backup, and the start and end time of the backup. The return value is the backup's ending transaction log location. After the end position is calculated, the insert position of the current transaction log automatically goes ahead to the next transaction log file. In this way, the ended transaction log file can be immediately archived so that backup is complete. - -- pg_switch_xlog() - - Description: Switches to a new transaction log file (restricted to the system administrator). - - Return type: text - - Note: **pg_switch_xlog** moves to the next transaction log file so that the current log file can be archived (if continuous archive is used). The return value is the ending transaction log location + 1 within the just-completed transaction log file. If there has been no transaction log activity since the last transaction log switchover, **pg_switch_xlog** will do nothing but return the start location of the transaction log file currently in use. - -- pg_xlogfile_name(location text) - - Description: Converts the position string in a transaction log to a file name. - - Return type: text - - Note: **pg_xlogfile_name** extracts only the transaction log file name. If the given transaction log position is the transaction log file border, a transaction log file name will be returned for both the two functions. This is usually the desired behavior for managing transaction log archiving, since the preceding file is the last one that currently needs to be archived. - -- pg_xlogfile_name_offset(location text) - - Description: Converts the position string in a transaction log to a file name and returns the byte offset in the file. - - Return type: text and integer - - Note: **pg_xlogfile_name_offset** can extract transaction log file names and byte offsets from the returned results of the preceding functions. Example: - - ```sql - MogDB=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); - NOTICE: pg_stop_backup cleanup done, waiting for required WAL segments to be archived - NOTICE: pg_stop_backup complete, all required WAL segments have been archived - file_name | file_offset - --------------------------+------------- - 000000010000000000000003 | 272 - (1 row) - ``` - -- pg_xlog_location_diff(location text, location text) - - Description: Calculates the difference in bytes between two transaction log locations. - - Return type: numeric - -- pg_cbm_tracked_location() - - Description: Queries the LSN location parsed by CBM. - - Return type: text - -- pg_cbm_get_merged_file(startLSNArg text, endLSNArg text) - - Description: Combines CBM files within the specified LSN range into one and returns the name of the combined file. - - Return type: text - - Note: Only the system administrator or O&M administrator can obtain the CBM combination file. - -- pg_cbm_get_changed_block(startLSNArg text, endLSNArg text) - - Description: Combines CBM files within the specified LSN range into a table and return records of this table. - - Return type: record - - Note: The table columns include the start LSN, end LSN, tablespace OID, database OID, table relfilenode, table fork number, whether the table is deleted, whether the table is created, whether the table is truncated, number of pages in the truncated table, number of modified pages, and list of modified page numbers. - -- pg_cbm_recycle_file(targetLSNArg text) - - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. - - Return type: text - -- pg_cbm_force_track(targetLSNArg text,timeOut int) - - Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. - - Return type: text - -- pg_enable_delay_ddl_recycle() - - Description: Enables DDL delay and returns the Xlog position of the enabling point. You need to enable **operate_mode** as the administrator or O&M administrator. - - Return type: text - -- pg_disable_delay_ddl_recycle(barrierLSNArg text, isForce bool) - - Description: Disables DDL delay and returns the Xlog range where DDL delay takes effect. You need to enable **operate_mode** as the administrator or O&M administrator. - - Return type: record - -- pg_enable_delay_xlog_recycle() - - Description: Enables Xlog recycle delay. This function is used in primary database node restoration. - - Return type: void - -- pg_disable_delay_xlog_recycle() - - Description: Disables Xlog recycle delay. This function is used in primary database node restoration. - - Return type: void - -- pg_cbm_rotate_file(rotate_lsn text) - - Description: Forcibly switches the file after the CBM parses **rotate_lsn**. This function is called during the build process. - - Return type: void - -- gs_roach_stop_backup(backupid text) - - Description: Stops a backup started by the internal backup tool GaussRoach. It is similar to the **pg_stop_backup system** function but is more lightweight. - - Return type: text. The content is the insertion position of the current log. - - Note: Currently, MogDB does not support this function. - -- gs_roach_enable_delay_ddl_recycle(backupid name) - - Description: Enables DDL delay and returns the log location of the enabling point. It is similar to the **pg_enable_delay_ddl_recycle** system function but is more lightweight. In addition, different **backupid** values can be used to concurrently open DDL statements with delay. - - Return type: text. The content is the log location of the start point. - - Note: Currently, MogDB does not support this function. - -- gs_roach_disable_delay_ddl_recycle(backupid text) - - Description: Disables DDL delay, returns the range of logs on which DDL delay takes effect, and deletes the physical files of column-store tables that are deleted by users within this range. It is similar to the **pg_enable_delay_ddl_recycle** system function but is more lightweight. In addition, the DDL delay function can be disabled concurrently by specifying different backupid values. - - Return type: record. The content is the range of logs for which DDL is delayed to take effect. - - Note: Currently, MogDB does not support this function. - -- gs_roach_switch_xlog(request_ckpt bool) - - Description: Switches the currently used log segment file and triggers a full checkpoint if **request_ckpt** is set to **true**. - - Return type: text. The content is the location of the segment log. - - Note: Currently, MogDB does not support this function. - -## Restoration Control Functions - -Restoration control functions provide information about the status of standby nodes. These functions may be executed both during restoration and in normal running. - -- pg_is_in_recovery() - - Description: Returns **true** if restoration is still in progress. - - Return type: bool - -- pg_last_xlog_receive_location() - - Description: Gets the last transaction log location received and synchronized to disk by streaming replication. While streaming replication is in progress, this will increase monotonically. If restoration has completed, this value will remain static at the value of the last WAL record received and synchronized to disk during restoration. If streaming replication is disabled or if it has not yet started, the function returns **NULL**. - - Return type: text - -- pg_last_xlog_replay_location() - - Description: Gets last transaction log location replayed during restoration. If restoration is still in progress, this will increase monotonically. If restoration has completed, then this value will remain static at the value of the last WAL record received during that restoration. When the server has been started normally without restoration, the function returns **NULL**. - - Return type: text - -- pg_last_xact_replay_timestamp() - - Description: Gets the timestamp of last transaction replayed during restoration. This is the time to commit a transaction or abort a WAL record on the primary node. If no transactions have been replayed during restoration, this function will return **NULL**. If restoration is still in progress, this will increase monotonically. If restoration has completed, then this value will remain static at the value of the last WAL record received during that restoration. If the server normally starts without manual intervention, this function will return **NULL**. - - Return type: timestamp with time zone - -Restoration control functions control restoration processes. These functions may be executed only during restoration. - -- pg_is_xlog_replay_paused() - - Description: Returns **true** if restoration is paused. - - Return type: bool - -- pg_xlog_replay_pause() - - Description: Pauses restoration immediately. - - Return type: void - -- pg_xlog_replay_resume() - - Description: Restarts restoration if it was paused. - - Return type: void - -While restoration is paused, no further database changes are applied. In hot standby mode, all new queries will see the same consistent snapshot of the database, and no further query conflicts will be generated until restoration is resumed. - -If streaming replication is disabled, the paused state may continue indefinitely without problem. While streaming replication is in progress, WAL records will continue to be received, which will eventually fill available disk space. This progress depends on the duration of the pause, the rate of WAL generation, and available disk space. +--- +title: Backup and Restoration Control Functions +summary: Backup and Restoration Control Functions +author: Zhang Cuiping +date: 2021-04-20 +--- + +# Backup and Restoration Control Functions + +## Backup Control Functions + +Backup control functions help with online backup. + +- pg_create_restore_point(name text) + + Description: Creates a named point for performing the restoration operation (restricted to the system administrator). + + Return type: text + + Note: **pg_create_restore_point** creates a named transaction log record that can be used as a restoration target, and returns the corresponding transaction log location. The given name can then be used with **recovery_target_name** to specify the point up to which restoration will proceed. Avoid creating multiple restoration points with the same name, since restoration will stop at the first one whose name matches the restoration target. + +- pg_current_xlog_location() + + Description: Obtains the write position of the current transaction log. + + Return type: text + + Note: **pg_current_xlog_location** displays the write position of the current transaction log in the same format as those of the previous functions. Read-only operations do not require permissions of the system administrator. + +- pg_current_xlog_insert_location() + + Description: Obtains the insert position of the current transaction log. + + Return type: text + + Note: **pg_current_xlog_insert_location** displays the insert position of the current transaction log. The insertion point is the logical end of the transaction log at any instant, while the write location is the end of what has been written out from the server's internal buffers. The write position is the end that can be detected externally from the server. This operation can be performed to archive only some of completed transaction log files. The insert position is mainly used for commissioning the server. Read-only operations do not require permissions of the system administrator. + +- gs_current_xlog_insert_end_location() + + Description: Obtains the insert position of the current transaction log. + + Return type: text + + Note: **gs_current_xlog_insert_end_location** displays the insert position of the current transaction log. + +- pg_start_backup(label text [, fast boolean ]) + + Description: Starts executing online backup (restricted to the system administrator or replication roles). + + Return type: text + + Note: **pg_start_backup** receives a user-defined backup label (usually the name of the position where the backup dump file is stored). This function writes a backup label file to the data directory of MogDB and then returns the start position of backed up transaction logs in text mode. + + ```sql + MogDB=# SELECT pg_start_backup('label_goes_here'); + pg_start_backup + ----------------- + 0/3000020 + (1 row) + ``` + +- pg_stop_backup() + + Description: Completes online backup (restricted to the system administrator or replication roles). + + Return type: text + + Note: **pg_stop_backup** deletes the label file created by **pg_start_backup** and creates a backup history file in the transaction log archive area. The history file includes the label given to **pg_start_backup**, the start and end transaction log locations for the backup, and the start and end time of the backup. The return value is the backup's ending transaction log location. After the end position is calculated, the insert position of the current transaction log automatically goes ahead to the next transaction log file. In this way, the ended transaction log file can be immediately archived so that backup is complete. + +- pg_switch_xlog() + + Description: Switches to a new transaction log file (restricted to the system administrator). + + Return type: text + + Note: **pg_switch_xlog** moves to the next transaction log file so that the current log file can be archived (if continuous archive is used). The return value is the ending transaction log location + 1 within the just-completed transaction log file. If there has been no transaction log activity since the last transaction log switchover, **pg_switch_xlog** will do nothing but return the start location of the transaction log file currently in use. + +- pg_xlogfile_name(location text) + + Description: Converts the position string in a transaction log to a file name. + + Return type: text + + Note: **pg_xlogfile_name** extracts only the transaction log file name. If the given transaction log position is the transaction log file border, a transaction log file name will be returned for both the two functions. This is usually the desired behavior for managing transaction log archiving, since the preceding file is the last one that currently needs to be archived. + +- pg_xlogfile_name_offset(location text) + + Description: Converts the position string in a transaction log to a file name and returns the byte offset in the file. + + Return type: text and integer + + Note: **pg_xlogfile_name_offset** can extract transaction log file names and byte offsets from the returned results of the preceding functions. Example: + + ```sql + MogDB=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup()); + NOTICE: pg_stop_backup cleanup done, waiting for required WAL segments to be archived + NOTICE: pg_stop_backup complete, all required WAL segments have been archived + file_name | file_offset + --------------------------+------------- + 000000010000000000000003 | 272 + (1 row) + ``` + +- pg_xlog_location_diff(location text, location text) + + Description: Calculates the difference in bytes between two transaction log locations. + + Return type: numeric + +- pg_cbm_tracked_location() + + Description: Queries the LSN location parsed by CBM. + + Return type: text + +- pg_cbm_get_merged_file(startLSNArg text, endLSNArg text) + + Description: Combines CBM files within the specified LSN range into one and returns the name of the combined file. + + Return type: text + + Note: Only the system administrator or O&M administrator can obtain the CBM combination file. + +- pg_cbm_get_changed_block(startLSNArg text, endLSNArg text) + + Description: Combines CBM files within the specified LSN range into a table and return records of this table. + + Return type: record + + Note: The table columns include the start LSN, end LSN, tablespace OID, database OID, table relfilenode, table fork number, whether the table is deleted, whether the table is created, whether the table is truncated, number of pages in the truncated table, number of modified pages, and list of modified page numbers. + +- pg_cbm_recycle_file(targetLSNArg text) + + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. + + Return type: text + + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + +- pg_cbm_force_track(targetLSNArg text,timeOut int) + + Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. + + Return type: text + +- pg_enable_delay_ddl_recycle() + + Description: Enables DDL delay and returns the Xlog position of the enabling point. You need to enable **operate_mode** as the administrator or O&M administrator. + + Return type: text + +- pg_disable_delay_ddl_recycle(barrierLSNArg text, isForce bool) + + Description: Disables DDL delay and returns the Xlog range where DDL delay takes effect. You need to enable **operate_mode** as the administrator or O&M administrator. + + Return type: record + +- pg_enable_delay_xlog_recycle() + + Description: Enables Xlog recycle delay. This function is used in primary database node restoration. + + Return type: void + +- pg_disable_delay_xlog_recycle() + + Description: Disables Xlog recycle delay. This function is used in primary database node restoration. + + Return type: void + +- pg_cbm_rotate_file(rotate_lsn text) + + Description: Forcibly switches the file after the CBM parses **rotate_lsn**. This function is called during the build process. + + Return type: void + +- gs_roach_stop_backup(backupid text) + + Description: Stops a backup started by the internal backup tool GaussRoach. It is similar to the **pg_stop_backup system** function but is more lightweight. + + Return type: text. The content is the insertion position of the current log. + + Note: Currently, MogDB does not support this function. + +- gs_roach_enable_delay_ddl_recycle(backupid name) + + Description: Enables DDL delay and returns the log location of the enabling point. It is similar to the **pg_enable_delay_ddl_recycle** system function but is more lightweight. In addition, different **backupid** values can be used to concurrently open DDL statements with delay. + + Return type: text. The content is the log location of the start point. + + Note: Currently, MogDB does not support this function. + +- gs_roach_disable_delay_ddl_recycle(backupid text) + + Description: Disables DDL delay, returns the range of logs on which DDL delay takes effect, and deletes the physical files of column-store tables that are deleted by users within this range. It is similar to the **pg_enable_delay_ddl_recycle** system function but is more lightweight. In addition, the DDL delay function can be disabled concurrently by specifying different backupid values. + + Return type: record. The content is the range of logs for which DDL is delayed to take effect. + + Note: Currently, MogDB does not support this function. + +- gs_roach_switch_xlog(request_ckpt bool) + + Description: Switches the currently used log segment file and triggers a full checkpoint if **request_ckpt** is set to **true**. + + Return type: text. The content is the location of the segment log. + + Note: Currently, MogDB does not support this function. + +## Restoration Control Functions + +Restoration control functions provide information about the status of standby nodes. These functions may be executed both during restoration and in normal running. + +- pg_is_in_recovery() + + Description: Returns **true** if restoration is still in progress. + + Return type: bool + +- pg_last_xlog_receive_location() + + Description: Gets the last transaction log location received and synchronized to disk by streaming replication. While streaming replication is in progress, this will increase monotonically. If restoration has completed, this value will remain static at the value of the last WAL record received and synchronized to disk during restoration. If streaming replication is disabled or if it has not yet started, the function returns **NULL**. + + Return type: text + +- pg_last_xlog_replay_location() + + Description: Gets last transaction log location replayed during restoration. If restoration is still in progress, this will increase monotonically. If restoration has completed, then this value will remain static at the value of the last WAL record received during that restoration. When the server has been started normally without restoration, the function returns **NULL**. + + Return type: text + +- pg_last_xact_replay_timestamp() + + Description: Gets the timestamp of last transaction replayed during restoration. This is the time to commit a transaction or abort a WAL record on the primary node. If no transactions have been replayed during restoration, this function will return **NULL**. If restoration is still in progress, this will increase monotonically. If restoration has completed, then this value will remain static at the value of the last WAL record received during that restoration. If the server normally starts without manual intervention, this function will return **NULL**. + + Return type: timestamp with time zone + +Restoration control functions control restoration processes. These functions may be executed only during restoration. + +- pg_is_xlog_replay_paused() + + Description: Returns **true** if restoration is paused. + + Return type: bool + +- pg_xlog_replay_pause() + + Description: Pauses restoration immediately. + + Return type: void + +- pg_xlog_replay_resume() + + Description: Restarts restoration if it was paused. + + Return type: void + +While restoration is paused, no further database changes are applied. In hot standby mode, all new queries will see the same consistent snapshot of the database, and no further query conflicts will be generated until restoration is resumed. + +If streaming replication is disabled, the paused state may continue indefinitely without problem. While streaming replication is in progress, WAL records will continue to be received, which will eventually fill available disk space. This progress depends on the duration of the pause, the rate of WAL generation, and available disk space. diff --git a/product/en/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md b/product/en/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md index 4a14dffd..446beb17 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ Backup control functions help with online backup. - pg_cbm_recycle_file(targetLSNArg text) - Description: Deletes the CBM files that are no longer used and returns the first LSN after the deletion. + Description: Delete all cbm file contents before targetLSNArg and return the first lsn after deletion. Return type: text + Note: This function does not check whether the deleted cbm file is invalid, so it is recommended to delete at most the contents of the cbm file corresponding to the most recent backup Stop lsn. If you delete the contents of the cbm file that has not been incrementally backed up, the incremental backup function will become invalid. + - pg_cbm_force_track(targetLSNArg text,timeOut int) Description: Forcibly executes the CBM trace to the specified Xlog position and returns the Xlog position of the actual trace end point. diff --git a/product/zh/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index 8eae7bfb..14e58fc5 100644 --- a/product/zh/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v1.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -121,10 +121,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index 8eae7bfb..14e58fc5 100644 --- a/product/zh/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v2.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -121,10 +121,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index d7c2cd47..51094141 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index 688e4d15..b24e93ae 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md index 688e4d15..b24e93ae 100644 --- a/product/zh/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v3.1/reference-guide/functions-and-operators/24-system-management-functions/4-backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md index 688e4d15..b24e93ae 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md b/product/zh/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md index 688e4d15..b24e93ae 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/functions-and-operators/system-management-functions/backup-and-restoration-control-functions.md @@ -131,10 +131,12 @@ date: 2021-04-20 - pg_cbm_recycle_file(targetLSNArg text) - 描述: 删除不再使用的cbm文件,并返回删除后的第一条lsn。 - + 描述: 删除targetLSNArg之前的所有cbm文件内容,并返回删除后的第一条lsn。 + 返回值类型: text + 备注:此函数并不会检查所删除的cbm文件是否无效,因此建议最多删除最近一次备份Stop lsn对应的cbm文件内容。如果删除了未进行增量备份的cbm文件内容将会导致增量备份功能失效。 + - pg_cbm_force_track(targetLSNArg text,timeOut int) 描述: 强制执行一次cbm追踪到指定的xlog位置,并返回实际追踪结束点的xlog位置。 -- Gitee