-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NSFS] Add support for restore-object #7507
[NSFS] Add support for restore-object #7507
Conversation
cdb3bc8
to
057611a
Compare
@tangledbytes what about adding a few unit tests? :) |
77a8d88
to
4e341f0
Compare
8a7f4b9
to
428533e
Compare
428533e
to
d3fb389
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments, but overall looks good!
const restore = [`ongoing-request="${object_md.restore_status.ongoing}"`]; | ||
if (!object_md.restore_status.ongoing && object_md.restore_status.expiry_time) { | ||
// Expiry time is in UTC format | ||
const expiry_date = new Date(object_md.restore_status.expiry_time).toUTCString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but what is the date format of the xattr user.noobaa.restore.expiry
?
is it a number? worth noting it here in the comment at least.
in nb.d.ts I see this is a Date... So unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned the format in the xattr comment (All the data types are mentioned in the comments).
/** | ||
* XATTR_RESTORE_EXPIRY is set to a ISO DATE by the underlying restore process or by | ||
* NooBaa (in case restore is issued again while the object is on disk). | ||
* This is read by the underlying "disk evict" process to determine if the object | ||
* should be evicted from the disk or not. | ||
* | ||
* NooBaa will use this date to determine if the object is on disk or not, if the | ||
* expiry date is in the future, the object is on disk, if the expiry date is in | ||
* the past, the object is not on disk. This may or may not represent the actual | ||
* state of the object on disk, but is probably good enough for NooBaa's purposes | ||
* assuming that restore request for already restored objects fails gracefully. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice comment! I wish we had such comments on all our xattrs...
b66ad0b
to
5ac2631
Compare
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> add changes to nb.d.ts Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix errors when no storage class is provided - treat as STANDARD Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix storage class assignment Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> address minor comments on the PR Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> add unit tests and minor fixes Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix unit tests Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix lint error Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix _is_storage_class_supported Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix unit test Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> revamp the implementation to adhere more closely to S3 behaviours Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> add assertions to ensure xattrs aren't leaked into objectmds Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> cleanup restore_status logic and fix expiry extension Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> fix broken get_object Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
5ac2631
to
64ce3cf
Compare
Explain the changes
This PR adds
restore-object
API in NSFS.storage-class
inhead/get-object
.