Justin James
Applications Engineer
iRODS Consortium
S3 Resource Plugin:
Glacier Support
S3 Resource Plugin:
Glacier Support
July 5-8, 2022
iRODS User Group Meeting 2022
Leuven, Belgium
Overview of S3 Glacier
Glacier storage classes are the archive tiers for S3.
Glacier Support on Object Read
Restoring an Object from Archive
To support the RestoreObject operation, two new resource context configuration settings have been introduced.
Note: RestoreObject is neither necessary nor allowed for objects stored in Glacier_IR.
Glacier | Deep Archive | |
---|---|---|
Expedited | 1-5 minutes | Not Allowed |
Standard (default) | 3-5 hours | Within 12 hours |
Bulk | 5-12 hours | Within 48 hours |
Glacier Support on Write or Copy
A new resource context setting has been added to define the storage class used when uploading data objects:
If defined, this setting is sent in the x-amz-storage-class header for PutObject and CopyObject.
Changes to libs3
The libs3 library did not have support for Glacier and Deep Archive. The following changes were made to our fork of this library:
Summary of New Resource Context Setting Options
Key | Valid Values | Description |
---|---|---|
S3_STORAGE_CLASS | STANDARD GLACIER DEEP_ARCHIVE GLACIER_IR |
The storage class assigned to the data object. Sent on PutObject and CopyObject. |
S3_RESTORATION_TIER | STANDARD BULK EXPEDITED |
When restoring an object, the restoration tier used. |
S3_RESTORATION_DAYS | Any positive integer | The number of days the object will be restored |
Example Glacier Setup and File Retrieval
Create a resource that places files in Glacier, performs expedited restorations , and restores for 1 day.
$ iadmin mkresc s3resc s3 `hostname`:/justinkylejames-irods1/amazons3resc "S3_DEFAULT_HOSTNAME=s3.amazonaws.com;S3_AUTH_FILE=/var/lib/irods/amazon.keypair;S3_REGIONNAME=us-east-1;S3_PROTO=HTTP;HOST_MODE=cacheless_attached;S3_STORAGE_CLASS=Glacier;S3_RESTORATION_TIER=Expedited;S3_RESTORATION_DAYS=1"
Creating resource:
Name: "s3resc"
Type: "s3"
Host: "ce61bbc3beec"
Path: "/justinkylejames-irods1/amazons3resc"
Context: "S3_DEFAULT_HOSTNAME=s3.amazonaws.com;S3_AUTH_FILE=/var/lib/irods/amazon.keypair;S3_REGIONNAME=us-east-1;S3_PROTO=HTTP;HOST_MODE=cacheless_attached;S3_STORAGE_CLASS=Glacier;S3_RESTORATION_TIER=Expedited;S3_RESTORATION_DAYS=1"
Create and put a file
$ echo test123 > test.txt $ iput -R s3resc test.txt
Example Glacier Setup and File Retrieval
Now try to get it again. Note the slightly different error message.
$ iget test.txt - remote addresses: 172.17.0.2 ERROR: getUtil: get error for - status = -721000 REPLICA_IS_BEING_STAGED Level 0: [-] /github/irods_resource_plugin_s3/s3/s3_transport/src/s3_transport.cpp:133:irods::error irods::experimental::io::s3_transport::handle_glacier_status(const std::string &, libs3_types::bucket_context &, const unsigned int, const std::string &, irods::experimental::io::s3_transport::object_s3_status, const std::string &) : status [REPLICA_IS_BEING_STAGED] errno [] -- message [Object is in GLACIER and is currently being restored. Try again later.]
Wait a few minutes and retrieve the file again:
$ iget test.txt -
test123
$ iget test.txt - remote addresses: 172.17.0.2 ERROR: getUtil: get error for - status = -721000 REPLICA_IS_BEING_STAGED Level 0: [-] /github/irods_resource_plugin_s3/s3/s3_transport/src/s3_transport.cpp:208:irods::error irods::experimental::io::s3_transport::restore_s3_object(const std::string &, libs3_types::bucket_context &, const unsigned int, const std::string &, const std::string &) : status [REPLICA_IS_BEING_STAGED] errno [] -- message [Object is in GLACIER and has been queued for restoration. Try again later.]
Try to get the object.
Release Status
Glacier support has been added to the S3 plugin and has been partially released.
What's Next:
Release support for Deep Archive and setting the storage class on PutObject and CopyObject.
Support for the intelligent tiering storage class should be trivial but has not been implemented or tested.
We could write a rule to read metadata on an atomic put and select the storage class dynamically for object level control.