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.
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.
REPLICATION_GROUP_REFRESH_PROGRESS( '<secondary_group_name>' )
REPLICATION_GROUP_REFRESH_PROGRESS_BY_JOB( '<query_id>' )
The function returns the following columns:
Name of the replication phases completed (or in progress) so far. For the list of phases, see the usage notes.
Time when the replication phase began.
Time when the phase finished, if applicable.
Empty for remaining phases
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:
COMPLETED / FAILED / CANCELED
totalBytesToReplicatevalue is estimated prior to the replication operation. This value may differ from the
totalBytesToDownloadvalue in the respective phase.
For example, if during the
PRIMARY_UPLOADING_DATAphase, a previous replication operation uploaded some bytes but was canceled before the operation completed, those bytes would not be uploaded again. In that case,
totalBytesToUploadwould be lower than
Retrieve the current progress of the replication group refresh for the
rg1 replication group:
select * from table(information_schema.replication_group_refresh_progress('rg1'));
Retrieve the current progress of a replication group refresh by query ID:
select * from table(information_schema.replication_group_refresh_progress_by_job('012a3b45-1234-a12b-0000-1aa200012345'));