- Categories:
REPLICATION_GROUP_REFRESH_PROGRESS, REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB¶
The REPLICATION_GROUP_REFRESH_PROGRESS family of functions can be used to query the status of a replication or failover group refresh:
REPLICATION_GROUP_REFRESH_PROGRESS returns a JSON object indicating the refresh status for a secondary replication or failover group by name.
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB returns a JSON object indicating the refresh status for a secondary replication or failover group by query ID.
Note
REPLICATION_GROUP_REFRESH_PROGRESS only returns the replication or failover group refresh activity for the most recent refresh if it occurred within the last 14 days.
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB returns replication or failover group refresh activity within the last 14 days.
Syntax¶
REPLICATION_GROUP_REFRESH_PROGRESS( '<secondary_group_name>' )
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB( '<query_id>' )
Arguments¶
Output¶
The function returns the following columns:
Column Name |
Data Type |
Description |
---|---|---|
PHASE_NAME |
TEXT |
Name of the replication phases completed (or in progress) so far. For the list of phases, see the usage notes. |
START_TIME |
TIMESTAMP_LTZ |
Time when the replication phase began. |
END_TIME |
TIMESTAMP_LTZ |
Time when the phase finished, if applicable. |
PROGRESS |
TEXT |
Empty for remaining phases |
DETAILS |
VARIANT |
|
Usage notes¶
Only returns rows for a role with any privilege on the replication or failover group.
Only returns rows for a secondary replication or failover group in the current account.
When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Snowflake Information Schema.
Following is the list of phases in the order processed:
#
Phase name
Description
1
SECONDARY_SYNCHRONIZING_MEMBERSHIP
The secondary replication or failover group receives information from the primary group about the objects included in the group, and updates its membership metadata.
2
SECONDARY_UPLOADING_INVENTORY
The secondary replication or failover group sends an inventory of its objects in the target account to the primary group.
3
PRIMARY_UPLOADING_METADATA
The primary replication or failover group creates a snapshot of metadata in the source account and sends it to the secondary group.
4
PRIMARY_UPLOADING_DATA
The primary replication or failover group copies the files the secondary group needs to reconcile any deltas between the objects in the source and target accounts.
5
SECONDARY_DOWNLOADING_METADATA
The secondary replication or failover group applies the snapshot of the metadata that was sent by the primary. The metadata updates are not applied atomically and instead applied over time.
6
SECONDARY_DOWNLOADING_DATA
The secondary replication or failover group copies the files sent by the primary group to the target account.
7
COMPLETED
/FAILED
/CANCELED
Refresh operation status.
In the
PRIMARY_UPLOADING_DATA
andSECONDARY_DOWNLOADING_DATA
phases, thetotalBytesToReplicate
value is estimated prior to the replication operation. This value may differ from thetotalBytesToUpload
ortotalBytesToDownload
value in the respective phase.For example, if during the
PRIMARY_UPLOADING_DATA
phase, a previous replication operation uploaded some bytes but was canceled before the operation completed, those bytes would not be uploaded again. In that case,totalBytesToUpload
would be lower thantotalBytesToReplicate
.
Examples¶
To retrieve the current refresh progress for replication group rg1
, execute the following
statement:
SELECT phase_name, start_time, end_time, progress, details
FROM TABLE(INFORMATION_SCHEMA.REPLICATION_GROUP_REFRESH_PROGRESS('rg1'));
To retrieve the replication group refresh progress by query ID, replace the query ID in the example and execute the following statement:
SELECT phase_name, start_time, end_time, progress, details
FROM TABLE(
INFORMATION_SCHEMA.REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB(
'012a3b45-1234-a12b-0000-1aa200012345'));