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.
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¶
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.
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
myaccount2account:ALTER FAILOVER GROUP myfg PRIMARY;
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:
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: