cnpgi

package
v0.0.0-...-980bd36 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 49 Imported by: 0 modules, 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 cnpgi provides the implementation for the sidecar container.

Index

Constants

View Source
const ArchiveConfigKey = "klio-archive"

ArchiveConfigKey is the config key of the archive PluginConfiguration. It must stay in sync with ArchiveConfigKey in operator/internal/klioconfig.

View Source
const KlioConfigDir = "/var/lib/postgresql/klio"

KlioConfigDir is the mount point of the projected klio-config volume, holding one file per resolved PluginConfiguration (e.g. klio-archive, the recovery source, the replica source). It must stay in sync with the mount path injected by the operator (KlioConfigDir in operator/internal/klioconfig).

Variables

View Source
var (
	// ErrVerificationCorruption is returned when backup verification detects corruption.
	ErrVerificationCorruption = errors.New("backup verification detected corruption")

	// ErrPodNameNotSet is returned when the POD_NAME environment variable is not set.
	ErrPodNameNotSet = errors.New("POD_NAME environment variable is not set")
)
View Source
var ErrConfigFileChanged = errors.New("config file changed, restarting")

ErrConfigFileChanged is returned when the config file changes on disk.

View Source
var ErrInstanceIsReplica = errors.New("instance is a replica")

ErrInstanceIsReplica is raised as a send-wal process cause when this instance got demoted.

Functions

func NewConfigFileWatcher

func NewConfigFileWatcher(
	configPath string,
	interval time.Duration,
) manager.RunnableFunc

NewConfigFileWatcher creates a manager.RunnableFunc that polls a config file, or every file in a config directory, and returns an error when the content changes. This causes the manager to shut down, and the kubelet will restart the container.

Polling is used instead of fsnotify because Kubernetes updates secret volumes via symlink swaps, which fsnotify may not detect reliably.

Types

type BackupCapabilityOptions

type BackupCapabilityOptions struct {
	Tier2 bool
}

BackupCapabilityOptions contains options for configuring the backup capability.

type CNPGI

type CNPGI struct {
	Client     client.Client
	PluginPath string
	// contains filtered or unexported fields
}

CNPGI is the implementation of the PostgreSQL sidecar.

func (*CNPGI) AddBackupCapability

func (c *CNPGI) AddBackupCapability(opts BackupCapabilityOptions)

AddBackupCapability adds the backup capability to the CNPGI service.

func (*CNPGI) AddRestoreCapability

func (c *CNPGI) AddRestoreCapability(pgDataPath string)

AddRestoreCapability adds the restore capability to the CNPGI service.

func (*CNPGI) AddWALCapability

func (c *CNPGI) AddWALCapability(opts WALCapabilityOptions)

AddWALCapability adds the WAL restore capabilities to the CNPGI service.

func (*CNPGI) Start

func (c *CNPGI) Start(ctx context.Context) error

Start starts the GRPC service.

type SendWalClusterReconciler

type SendWalClusterReconciler struct {
	client.Client

	// PodName is the name of this instance
	PodName string

	KlioConfigFile string
	// contains filtered or unexported fields
}

SendWalClusterReconciler reconciles a Cluster object.

func (*SendWalClusterReconciler) Reconcile

Reconcile is invoked every time something changes in the cluster.

func (*SendWalClusterReconciler) SetupWithManager

func (r *SendWalClusterReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type WALCapabilityOptions

type WALCapabilityOptions struct {
	Debug bool
}

WALCapabilityOptions are the options to configure the WAL service.

Jump to

Keyboard shortcuts

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