You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Highlights
s2-server answers HeadObject of an archived object with 200 and its storage class again, as S3 does (#579, fixes #578). v0.37.0, and only v0.37.0, answered a bare 403. This concerns an s2-server built with the server_s3 or server_azblob tag; the official binaries and image include osfs and memfs only and answer as before.
aws s3 sync and aws s3 cp through s2-server now skip an archived object with a warning and exit with status 2, as on S3 (#579), measured with the AWS CLI (v2) through an s2-server on real S3 and Azure.
s2-server reports storage classes as S3 does (#579): GetObject and HeadObject send x-amz-storage-class, and ListObjectsV2 names each object's class instead of always STANDARD.
s2.Stat returns the attributes of an object whose body cannot be read, and s2.StorageClassOf reports its storage class and restore state (#579). Get is unchanged and still refuses an archived object with errors.ErrUnsupported.
Changes
Fixed
server: HeadObject of an archived object answers 200 with its attributes, where v0.37.0 answered a bare 403; GetObject of it still answers 403 InvalidObjectState, now with <StorageClass> in its body (#579, fixes #578)
server: GetObject and HeadObject send x-amz-storage-class (none for STANDARD), x-amz-archive-status and x-amz-restore, and ListObjectsV2 names the class the backend reports, STANDARD when it reports none (#579)
server: the console's meta answers 200 for an archived object, where v0.37.0 answered 403 (#579)
Features
s2: Stat and the optional Stater interface, which return an object Get refuses with errors.ErrUnsupported; StorageClass, the optional StorageClasser interface on an Object, and StorageClassOf (#579)
s3, azblob: implement Stater and report the storage class on objects from Get, Stat and List; azblob reports the Azure Archive tier as DEEP_ARCHIVE (#579)
s2test: TestStorageStat; StorageDelegator gains StatFunc and a Stat method (#579)
Documentation
docs/backends.md describes s2.Stat, s2.StorageClassOf and the storage class headers (#579)
server, imported by the module's tests only: aws-sdk-go-v2 credentials 1.21.0 → 1.21.3 and service/s3 1.114.10 → 1.116.0 (#580); chromedp 0.23.1 → 0.24.0 and cdproto 0.160.3 → 0.160.8 (#581)
CI / Build
Bump intra-repo deps to v0.38.0 (#583); v0.37.0 bookkeeping for cmd/s2-server (#577)
Upgrading
Submodule consumers: go get github.com/mojatter/s2/<module>@v0.38.0
s2-server operators running the image: docker pull mojatter/s2-server:0.38.0 (:latest points at it too)
cmd/s2-server/v0.38.0 is published separately, shortly after: go install github.com/mojatter/s2/cmd/s2-server@v0.38.0
No module's go directive moved and go.work is unchanged since v0.37.0.
No configuration changes and no change to the data at rest; downgrading to v0.37.0 is safe.
Library users
Nothing existing changes. To read the size, ETag or metadata of an archived object on s3 or azblob, call s2.Stat(ctx, strg, name) in place of strg.Get; the object it returns cannot be opened.
s2.StorageClassOf(obj) reports the class of an object from Stat, Get or List. On s3 a listed object carries the class name alone, so Stat an object to learn its restore state. On azblob, DEEP_ARCHIVE marks a blob that must be rehydrated before reading, not S3's pricing or retention; a rehydrated blob reports no class, and Restored is never set.
Storage implementers
Stater and StorageClasser are optional: an existing implementation compiles and behaves as before. A wrapper that embeds s2.Storage does not expose the inner storage's Stat, so s2.Stat on it goes through the wrapper's Get. To implement Stater, answer as Get does for every other name, make Open and OpenRange of an object Get refuses fail with an error wrapping errors.ErrUnsupported, and never set both Restoring and Restored. What s2-server does with both interfaces is in docs/backends.md.
s2test.TestStorageStat is new and expects s2.Stat to answer as Get does; call it from your suite, since no other check runs it. s2test.StorageDelegator now satisfies s2.Stater. No other s2test check changed since v0.37.0.
s2-server operators
The official binaries and image include osfs and memfs only; nothing changes for them and there is nothing to do.
An s2-server built with the server_s3 or server_azblob tag: a 200 from HeadObject no longer means the object can be read, so read x-amz-storage-class, x-amz-archive-status and x-amz-restore. Each HeadObject or GetObject of an archived object now costs two attribute requests on the backend, where v0.37.0 sent one. The details, and what a downgrade brings back, are in docs/upgrading.md.