replication

package
v1.31.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package replication contains the code relative to the synchronous replication feature

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrossDomainConstraintSatisfied

func CrossDomainConstraintSatisfied(cluster *apiv1.Cluster) (satisfied bool, topologyUsable bool)

CrossDomainConstraintSatisfied reports whether enough electable standbys are in a failure domain different from the primary's for the failure domain constraint to be applied to synchronous_standby_names, using the same candidates and threshold as the replication path. The second return value is false when the failure domain keys are not configured or the topology cannot be used.

func GetExpectedSyncReplicasNumber

func GetExpectedSyncReplicasNumber(ctx context.Context, cluster *apiv1.Cluster) int

GetExpectedSyncReplicasNumber computes the actual number of required synchronous replicas

func GetSyncReplicasBounds

func GetSyncReplicasBounds(cluster *apiv1.Cluster) (minReplicas, maxReplicas int)

GetSyncReplicasBounds returns the minimum and the maximum number of synchronous replicas the cluster is configured to have.

With the legacy configuration these are `.spec.minSyncReplicas` and `.spec.maxSyncReplicas`. With `.spec.postgresql.synchronous` the maximum is the configured `number`, and the minimum is the same number when the data durability is required, or zero when it is preferred, as the number of synchronous replicas can then be lowered to what is available.

func GetSynchronousStandbyNames

func GetSynchronousStandbyNames(ctx context.Context, cluster *apiv1.Cluster) postgres.SynchronousStandbyNamesConfig

GetSynchronousStandbyNames gets the value to be applied to synchronous_standby_names

Types

This section is empty.

Jump to

Keyboard shortcuts

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