Documentation
¶
Overview ¶
Package blobstore is the engine's store of layer blobs: files named by their digest under one directory, which containerd's metadata store records and collects (core/metadata's contentStore wraps it).
It writes nothing synchronously. The engine already runs its own databases without syncing and keeps no promise across a host crash (server.Server.GracefulStop explains why), and a sync made while containerd's metadata store holds its one write lock stalls every other write behind it on a busy disk. A blob a crash left short or wrong is caught where it is read: ReaderAt checks its size, unpacking checks its diff ID, and remote-cache uploads check its digest.
A write is never resumed: reopening a write starts it over. Every engine writer writes a whole blob under its own ref, or under a ref named by the blob's digest that only one writer holds at a time.
The layout is containerd's local store's (blobs/<algorithm>/<encoded>, and ingest/<sha256 of the ref>/ holding the write's ref and data), so an engine state written by that store reads the same.
Index ¶
- type Store
- func (s *Store) Abort(_ context.Context, ref string) error
- func (s *Store) Delete(_ context.Context, dgst digest.Digest) error
- func (s *Store) Info(_ context.Context, dgst digest.Digest) (content.Info, error)
- func (s *Store) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error)
- func (s *Store) ReaderAt(_ context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error)
- func (s *Store) Status(_ context.Context, ref string) (content.Status, error)
- func (s *Store) Update(context.Context, content.Info, ...string) (content.Info, error)
- func (s *Store) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error
- func (s *Store) WalkStatusRefs(ctx context.Context, fn func(string) error) error
- func (s *Store) Writer(_ context.Context, opts ...content.WriterOpt) (content.Writer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a content.Store of blobs under root.
func (*Store) Abort ¶
Abort removes the write under ref. A writer that still holds it fails when it commits.
func (*Store) ListStatuses ¶
ListStatuses lists every write. It takes no filters, as Walk.
func (*Store) ReaderAt ¶
ReaderAt opens the blob desc names. It fails when the stored blob isn't desc's size, as a host crash can leave it.
func (*Store) Walk ¶
Walk calls fn for every blob. It takes no filters: containerd's metadata store filters its own records and walks this store only to collect it.
func (*Store) WalkStatusRefs ¶
WalkStatusRefs calls fn with the ref of every write, open or left behind. containerd's metadata store aborts those it has no record of.