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 ¶
- func Register(r *metadatadb.Registry, clientProvider s3client.ClientProvider)
- type Backend
- func (b *Backend) Apply(ctx context.Context, namespace string, ops ...metadatadb.Op) error
- func (b *Backend) Close(_ context.Context) error
- func (b *Backend) Flush(ctx context.Context, namespace string) error
- func (b *Backend) Query(_ context.Context, namespace string, q metadatadb.ReadOp, target any) error
- type Config
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.
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.