s3

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package s3 implements the S3 metadata backend as an append-only journal of immutable op segments plus a compacted rollup snapshot, replayed in a canonical order all replicas agree on. See docs/metadatadb-s3.md for the design and its invariants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(r *metadatadb.Registry, clientProvider s3client.ClientProvider)

Register registers the S3 metadata backend. The clientProvider supplies the shared minio client constructed from the global s3 config block.

Types

type Backend

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

Backend stores metadata as immutable op segments in S3, compacted into a rollup snapshot. Writes are synchronous group-committed segment PUTs; queries serve local state refreshed by a per-namespace background sync tick. It requires GET/PUT/LIST/DELETE permissions and a store with strong list-after-write consistency and enforced conditional writes (AWS S3, MinIO).

func New

func New(ctx context.Context, clientProvider s3client.ClientProvider, config Config) (*Backend, error)

New creates an S3 metadata backend, verifying the bucket exists.

func (*Backend) Apply

func (b *Backend) Apply(ctx context.Context, namespace string, ops ...metadatadb.Op) error

func (*Backend) Close

func (b *Backend) Close(_ context.Context) error

Close stops all per-namespace goroutines. It is idempotent.

func (*Backend) Flush

func (b *Backend) Flush(ctx context.Context, namespace string) error

Flush runs a sync tick now and returns its error. Its LIST starts after this call, so every write durable before the call is observed.

func (*Backend) Query

func (b *Backend) Query(_ context.Context, namespace string, q metadatadb.ReadOp, target any) error

type Config

type Config struct {
	Bucket       string        `hcl:"bucket" help:"S3 bucket name."`
	SyncInterval time.Duration `hcl:"sync-interval,optional" help:"Interval between background sync ticks." default:"15s"`
	LockTTL      time.Duration `hcl:"lock-ttl,optional" help:"Deprecated; the backend is lock-free."`
}

Config configures the S3 metadata backend.

Jump to

Keyboard shortcuts

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