sendwal

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: 24 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 sendwal implements the WAL receiver

Index

Constants

This section is empty.

Variables

View Source
var ErrMessageReceiverClosed = errors.New("message receiver closed")

ErrMessageReceiverClosed is a fallback returned when the background receive loop of a messageReceiver has exited without recording an error, which should not normally happen.

Functions

This section is empty.

Types

type ParseReadReplicationSlotResult

type ParseReadReplicationSlotResult struct {
	SlotType   string
	RestartLSN pglogrepl.LSN
	RestartTLI int
}

ParseReadReplicationSlotResult is the parsed result of the READ_REPLICATION_SLOT command.

func ParseReadReplicationSlot

func ParseReadReplicationSlot(mrr *pgconn.MultiResultReader) (ParseReadReplicationSlotResult, error)

ParseReadReplicationSlot parses the result of the READ_REPLICATION_SLOT command.

func ReadReplicationSlot

func ReadReplicationSlot(
	ctx context.Context,
	conn *pgconn.PgConn,
	slotName string,
) (ParseReadReplicationSlotResult, error)

ReadReplicationSlot executes the READ_REPLICATION_SLOT command.

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process implements the WAL sender service.

func New

func New(cfg *config.Data, logger log.Logger, client *grpcclient.Connection, sendToTier2 bool) *Process

New creates a new receiver.

func (*Process) ResetReplicationStatus

func (s *Process) ResetReplicationStatus(
	ctx context.Context,
) error

ResetReplicationStatus resets the replication status on the server side and then drops the Klio replication slot.

func (*Process) Start

func (s *Process) Start(ctx context.Context) error

Start the WAL receiver.

type ReadReplicationSlotParserError

type ReadReplicationSlotParserError struct {
	// contains filtered or unexported fields
}

ReadReplicationSlotParserError is raised the answer to a READ_REPLICATION_SLOT query is not in the expected format.

func NewReplicationSlotParserError

func NewReplicationSlotParserError(format string, args ...any) *ReadReplicationSlotParserError

NewReplicationSlotParserError creates a new ReplicationSlotParserError.

func (*ReadReplicationSlotParserError) Error

Error implements the error interface.

type UnexpectedCopydataMessageError

type UnexpectedCopydataMessageError struct {
	// contains filtered or unexported fields
}

UnexpectedCopydataMessageError is raised from the WAL receiver got a CopyData message of unknown type.

func NewUnexpectedCopydataMessageError

func NewUnexpectedCopydataMessageError(msg []byte) *UnexpectedCopydataMessageError

NewUnexpectedCopydataMessageError creates a new unexpected copy data message.

func (*UnexpectedCopydataMessageError) Error

Error implements the error interface.

type UnexpectedMessageError

type UnexpectedMessageError struct {
	// contains filtered or unexported fields
}

UnexpectedMessageError is raised from the WAL receiver got a CopyData message of unknown type.

func NewUnexpectedMessageError

func NewUnexpectedMessageError(msg pgproto3.BackendMessage) *UnexpectedMessageError

NewUnexpectedMessageError creates a new unexpected copy data message.

func (*UnexpectedMessageError) Error

func (e *UnexpectedMessageError) Error() string

Error implements the error interface.

Directories

Path Synopsis
Package buffer implements a WAL receiver buffer
Package buffer implements a WAL receiver buffer
Package infrastructure is the layer that directly interacts with external components.
Package infrastructure is the layer that directly interacts with external components.

Jump to

Keyboard shortcuts

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