collectionwal

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = 1024
	MiB = 1024 * KiB
	GiB = 1024 * MiB
)
View Source
const (
	MaxEncodedTransactionBytes            = 16 * MiB
	MaxOuterFramePayloadBytes             = MaxEncodedTransactionBytes
	DefaultSegmentBytes                   = 64 * MiB
	MaxSegmentBytes                       = 1 * GiB
	MaxRootDeltasPerTransaction           = 64
	MaxMutatedRootsPerTransaction         = 64
	MaxInlineRootDeltaBytesPerTransaction = 4 * MiB
	MaxInlineRootDeltaBytesPerRoot        = 1 * MiB
	MaxRootDeltaPayloadSideRefBytes       = 64 * MiB
	MaxDecodedRootDeltaEntriesPerTxn      = 262_144
	MaxDeltaKeyBytes                      = 16 * KiB
	MaxDocumentIDBytes                    = MaxDeltaKeyBytes
	MaxInlineDeltaValueBytes              = 1 * MiB
	MaxSideRefsPerTransaction             = 16_384
	MaxDescriptorOpsPerTransaction        = 1_024
	MaxLogicalNameBytes                   = 128
	MaxRootNameBytes                      = 256
	MaxRelativePathBytes                  = 512
	MaxRelativePathComponents             = 16
	MaxRelativePathComponentBytes         = 128
	MaxResolvedAbsolutePathBytes          = 4096
	MaxVarintBytes                        = 10
	MaxCompressedDecodedBytes             = 64 * MiB
	DefaultRecoveryHeapBudgetBytes        = 128 * MiB
	CollectionUIDBytes                    = 16
	CRC32IEEEBytes                        = 4
)

Variables

View Source
var (
	ErrCollectionWALTerminalTail       = errors.New("collectionwal: terminal incomplete tail")
	ErrCollectionWALCorruptMiddle      = errors.New("collectionwal: corrupt middle")
	ErrCollectionWALBadChecksum        = errors.New("collectionwal: bad checksum")
	ErrCollectionWALUnsupportedVersion = errors.New("collectionwal: unsupported version")
	ErrCollectionWALResourceLimit      = errors.New("collectionwal: resource limit")
	ErrCollectionWALUnsafePath         = errors.New("collectionwal: unsafe path")
	ErrCollectionWALMissingSideRef     = errors.New("collectionwal: missing side ref")
	ErrCollectionWALIdentityMismatch   = errors.New("collectionwal: identity mismatch")
	ErrCollectionWALSequenceGap        = errors.New("collectionwal: sequence gap")
	ErrCollectionWALRedacted           = errors.New("collectionwal: redacted")
	ErrCollectionWALRecoveryRequired   = errors.New("collectionwal: recovery required")
	ErrCollectionWALUnsupportedMode    = errors.New("collectionwal: unsupported mode")
)

Functions

func DirtySegments

func DirtySegments(dbDir string) ([]string, error)

DirtySegments returns collection WAL segments in dbDir/wal. It intentionally does not consult cleanup metadata yet; until that reader exists, every collection WAL segment is treated as requiring read-write recovery.

func IsSegmentName

func IsSegmentName(name string) bool

IsSegmentName reports whether name is a canonical collection WAL segment name. The v1 cleanup scanner treats any such segment as dirty until the full segment classifier and cleanup-manifest reader are available.

func RequireCleanForOfflineMaintenance

func RequireCleanForOfflineMaintenance(dbDir string) error

func RequireCleanForReadOnlyOpen

func RequireCleanForReadOnlyOpen(dbDir string) error

func ValidateClassRootDir

func ValidateClassRootDir(dir string) error

ValidateClassRootDir performs the portable subset of the collection WAL class root safety checks, including POSIX permission bits on platforms where those bits are authoritative. OS-specific openat/no-follow/owner/inode validation must run in the actual file opener before collection WAL can use a class root.

func ValidateEncodedTransactionSize

func ValidateEncodedTransactionSize(n uint64) error

func ValidateFramePayloadSize

func ValidateFramePayloadSize(n uint64) error

func ValidateRelativePath

func ValidateRelativePath(p string) error

ValidateRelativePath validates advisory side-ref path metadata. A valid path is still not authority to open or delete a file; collection WAL cleanup must resolve the file through the trusted RefClass/FileID registry.

func ValidateV1RefClass

func ValidateV1RefClass(c RefClass) error

Types

type BackupMode

type BackupMode uint8
const (
	BackupModeCleanCheckpoint BackupMode = iota + 1
	BackupModeWALSnapshot
)

func (BackupMode) String

func (m BackupMode) String() string

type DurableAckCapability

type DurableAckCapability uint8
const (
	DurableAckDisabled DurableAckCapability = iota
	DurableAckNoIndexRowInsertOnly
)

func (DurableAckCapability) Enabled

func (c DurableAckCapability) Enabled() bool

func (DurableAckCapability) String

func (c DurableAckCapability) String() string

type MaintenanceBarrierSnapshot

type MaintenanceBarrierSnapshot struct {
	ProtectedRefs        []ProtectedRef
	UnclassifiedPrepares int
	BackupPins           int
	RecoveryComplete     bool
}

func (MaintenanceBarrierSnapshot) CanMutate

func (s MaintenanceBarrierSnapshot) CanMutate() bool

type ProtectedRef

type ProtectedRef struct {
	Class         RefClass
	FileID        uint64
	Offset        uint64
	Length        uint64
	ChecksumCRC32 uint32
	CollectionSeq uint64
	WALLSN        uint64
	Reason        ProtectionReason
}

type ProtectionReason

type ProtectionReason uint8
const (
	ProtectionPrepared ProtectionReason = iota + 1
	ProtectionWALCommitted
	ProtectionPendingPublish
	ProtectionCollectionReadView
	ProtectionBackupManifest
	ProtectionCleanupPending
)

func (ProtectionReason) String

func (r ProtectionReason) String() string

type RefClass

type RefClass uint8
const (
	RefClassInvalid RefClass = iota
	RefClassValueLogRecord
	RefClassLeafLogRecord
	RefClassRootDeltaPayload
	RefClassColumnManifest
	RefClassColumnSubstreamFile
	RefClassColumnFilterFile
	RefClassColumnDeleteBitmapFile
	RefClassColumnDictionaryFile
	RefClassColumnMetadataFile
)

func (RefClass) KnownV1

func (c RefClass) KnownV1() bool

func (RefClass) String

func (c RefClass) String() string

type SideRefLifecycleState

type SideRefLifecycleState uint8
const (
	SideRefStateAbsent SideRefLifecycleState = iota
	SideRefStatePrepared
	SideRefStateWALCommitted
	SideRefStateMaterializedUnpublished
	SideRefStateApplied
	SideRefStateCleanable
	SideRefStateCleaned
	SideRefStateQuarantined
)

func (SideRefLifecycleState) String

func (s SideRefLifecycleState) String() string

Jump to

Keyboard shortcuts

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