wal

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: 2 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 wal contains reusable code for WAL interactions.

Index

Constants

View Source
const GRPCInitialConnWindowSizeBytes = 64 * 1024 * 1024 // 64 MiB

GRPCInitialConnWindowSizeBytes is the HTTP/2 per-connection flow-control window. It must be at least as large as GRPCInitialWindowSizeBytes; we oversize it to leave room for multiple concurrent streams on the same connection.

View Source
const GRPCInitialWindowSizeBytes = 16 * 1024 * 1024 // 16 MiB

GRPCInitialWindowSizeBytes is the HTTP/2 per-stream flow-control window used by both the WAL gRPC client and server. Sized at 2× MaxBlockSizeBytes so that streaming a WAL block does not require multiple WINDOW_UPDATE round trips.

View Source
const GRPCOverheadBytes = 512 * 1024 // 512 KiB

GRPCOverheadBytes is the extra allowance we add server-side to account for gRPC framing (compressed proto headers, envelopes, etc.). Empirically sized at 512 KiB to safely accommodate framing for an 8 MiB payload.

View Source
const GRPCSocketBufferSizeBytes = 1 * 1024 * 1024 // 1 MiB

GRPCSocketBufferSizeBytes is the TCP socket read/write buffer size hint for the gRPC transport. Larger values help sustain high throughput on links with non-trivial RTT.

View Source
const MaxBlockSizeBytes = 8 * 1024 * 1024 // 8 MiB

MaxBlockSizeBytes is the maximum WAL block payload size (without gRPC framing) accepted by the server. Client-side commands sending WAL data must keep each message <= this size.

View Source
const MaxGRPCMessageSizeBytes = MaxBlockSizeBytes + GRPCOverheadBytes

MaxGRPCMessageSizeBytes is the maximum total message size (payload + gRPC framing) we accept/send.

View Source
const PartialSuffix = ".partial"

PartialSuffix is the suffix carried by a WAL segment that was not fully received, such as one left behind by a failover.

Variables

This section is empty.

Functions

func IsPartialWALFile

func IsPartialWALFile(name string) bool

IsPartialWALFile reports whether name is the .partial variant of a complete WAL segment, such as one left behind by a failover.

func IsWALSegmentOrPartial

func IsWALSegmentOrPartial(name string) bool

IsWALSegmentOrPartial reports whether name is a complete WAL segment or its .partial variant.

func TrimPartialSuffix

func TrimPartialSuffix(name string) string

TrimPartialSuffix returns name without the .partial suffix.

func WithPartialSuffix

func WithPartialSuffix(name string) string

WithPartialSuffix returns name with the .partial suffix, if it does not already have it.

Types

type Feedback

type Feedback struct {
	// corresponding to flush_lsn in pg_stat_replication
	FlushLSN uint64

	// corresponding to write_lsn in pg_stat_replication
	WriteLSN uint64

	// corresponding to replay_lsn in pg_stat_replication
	ReplayLSN uint64
}

Feedback represents the feedback we get from the Klio server when writing a WAL file.

Jump to

Keyboard shortcuts

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