Failing Over Account Objects¶
This topic describes the steps necessary to fail over replicated account objects across multiple accounts in different regions for disaster recovery.
Prerequisite Requirements¶
Enable replication for a primary failover group in a set of accounts.
Create at least one secondary failover group (i.e. replica) of the primary failover group in one or more accounts and regularly refresh (i.e. synchronize) the replica with the latest updates to the objects in the failover group.
For instructions, see Replicating Account Objects.
Promoting a Target Account to Serve as the Source Account¶
To promote a target account to serve as the source account, execute the ALTER FAILOVER GROUP … PRIMARY command.
Promote a Secondary Failover Group to Primary Failover Group¶
Note
The example in this section must be executed by a role with the FAILOVER privilege.
For instructions on creating a custom role with a specified set of privileges, see Creating Custom Roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
The following example promotes myaccount2
in the current myorg
organization to serve as the source account for replication of the
objects specified in the failover group myfg
.
Executed from
myaccount2
account:ALTER FAILOVER GROUP myfg PRIMARY;
Resume Scheduled Replication in Target Accounts¶
On failover, scheduled refreshes on all secondary failover groups are suspended. ALTER FAILOVER GROUP … RESUME must be executed in each target account with a secondary failover group to resume automatic refreshes.
ALTER FAILOVER GROUP myfg RESUME;
Reopen Active Channels for Snowpipe Streaming in Newly Promoted Source Account¶
Tables in a primary database that are populated by Snowpipe Streaming are replicated to secondary databases. After failover, reopen active Snowpipe Streaming channels for tables and re-insert any missing data rows for the channels:
Reopen active channels for the table by calling the openChannel API.
Fetch offset tokens:
Call the getLatestCommittedOffsetToken API or
Execute the SHOW CHANNELS command to retrieve a list of the active channels of the table.
Re-insert data rows for the channel from the fetched offset tokens.
Snowpipe Streaming and the Kafka Connector¶
If you are using the Kafka connector and Snowpipe Streaming, follow these steps after failover:
Update the Kafka connector configuration to point to the newly promoted source account.
Execute the SHOW CHANNELS command to retrieve the list of active channels and the offset tokens. Each channel belongs to a single partition in the Kafka topic.
Manually reset offsets in the Kafka Topic for each of those partitions (channels).
Restart the Kafka Connector.
For more information, refer to: