recovery

package
v0.0.0-...-6b32d26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2021 SANGFOR TECHNOLOGIES

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceAnalysisEntry

func ForceAnalysisEntry(dbt string, clusterName string, analysisCode dtstruct.AnalysisCode, commandHint string, failedInstanceKey *dtstruct.InstanceKey) (analysisEntry dtstruct.ReplicationAnalysis, err error)

ForceAnalysisEntry construct replication analysis entry by force using specified analysis code and command hit on given failed instance

func ForceExecuteRecovery

func ForceExecuteRecovery(analysisEntry dtstruct.ReplicationAnalysis, candidateInstanceKey *dtstruct.InstanceKey, skipProcesses bool) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error)

ForceExecuteRecovery can be called to issue a recovery process even if analysis says there is no recovery case. The caller of this function injects the type of analysis it wishes the function to assume. By calling this function one takes responsibility for one's actions.

func ForceMasterFailOver

func ForceMasterFailOver(dbt string, clusterName string) (topologyRecovery *dtstruct.TopologyRecovery, err error)

ForceMasterFailOver trust master of given cluster is dead and initiates a fail over

func ForceMasterTakeover

func ForceMasterTakeover(clusterName string, destination dtstruct.InstanceAdaptor) (topologyRecovery *dtstruct.TopologyRecovery, err error)

ForceMasterTakeover trust master of given cluster is dead and fails over to designated instance which has to be its direct child.

func GracefulMasterTakeover

func GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, promotedMasterCoordinates *dtstruct.LogCoordinates, err error)

GracefulMasterTakeover will demote master of existing topology and promote its direct replica instead. It expects that replica to have no siblings. This function is graceful in that it will first lock down the master, then wait for the designated replica to catch up with last position. It will point old master at the newly promoted master at the correct coordinates, but will not start replication.

func RefreshTopologyInstance

func RefreshTopologyInstance(instanceKey *dtstruct.InstanceKey) (*dtstruct.Instance, error)

RefreshTopologyInstance will synchronously re-read topology instance

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL