replicationslot

package
v1.28.0-rc1 Latest Latest
Warning

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

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

Documentation

Overview

Package replicationslot provides functions to manage the replication slot of a cnpg cluster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreSameLsn

func AreSameLsn(lsnList []string) bool

AreSameLsn returns true if all the LSN values inside a given list are the same

func GetExpectedHAReplicationSlotsOnPod

func GetExpectedHAReplicationSlotsOnPod(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName, podName string,
) ([]string, error)

GetExpectedHAReplicationSlotsOnPod returns a slice of replication slot names which should be present in a given pod

func GetReplicationSlotLsnsOnPod

func GetReplicationSlotLsnsOnPod(
	ctx context.Context,
	crudClient client.Client,
	kubeInterface kubernetes.Interface,
	restConfig *rest.Config,
	namespace, clusterName, dbName string,
	pod corev1.Pod,
) ([]string, error)

GetReplicationSlotLsnsOnPod returns a slice containing the current restart_lsn values of each replication slot present in a given pod

func GetReplicationSlotsOnPod

func GetReplicationSlotsOnPod(
	ctx context.Context,
	crudClient client.Client,
	kubeInterface kubernetes.Interface,
	restConfig *rest.Config,
	namespace, podName, dbName string,
) ([]string, error)

GetReplicationSlotsOnPod returns a slice containing the names of the current replication slots present in a given pod

func PrintReplicationSlots

func PrintReplicationSlots(
	ctx context.Context,
	crudClient client.Client,
	kubeInterface kubernetes.Interface,
	restConfig *rest.Config,
	namespace, clusterName, dbName string,
) string

PrintReplicationSlots prints replications slots with their restart_lsn

func ToggleHAReplicationSlots

func ToggleHAReplicationSlots(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
	enable bool,
) error

ToggleHAReplicationSlots sets the HA Replication Slot feature on/off depending on `enable`

func ToggleSynchronizeReplicationSlots

func ToggleSynchronizeReplicationSlots(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
	enable bool,
) error

ToggleSynchronizeReplicationSlots sets the Synchronize Replication Slot feature on/off depending on `enable`

Types

This section is empty.

Jump to

Keyboard shortcuts

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