Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Fix default retention mode with multipart uploaded objects #254

Conversation

giubacc
Copy link

@giubacc giubacc commented Nov 22, 2023

When an object is uploaded with multipart, for object-lock enabled buckets,
the default rentention mode must be set in the object's attributes
(when a retention mode is not explicitely set by the user for the object).
Therefore, RGW_ATTR_OBJECT_RETENTION must be set in the attrs of each part
being uploaded in the SFSMultipartUploadV2::complete() function.

Fixes: https://github.com/aquarist-labs/s3gw/issues/761

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

@giubacc giubacc self-assigned this Nov 22, 2023
@giubacc giubacc added kind/bug Something isn't working area/rgw-sfs RGW & SFS related labels Nov 22, 2023
@giubacc giubacc added this to the v0.24.0 milestone Nov 22, 2023
@giubacc giubacc requested review from irq0 and jecluis November 23, 2023 08:09
irq0
irq0 previously requested changes Nov 23, 2023
Copy link
Member

@irq0 irq0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please namespace the types as we do in the rest of the code. Otherwise looks good

Giuseppe Baccini added 2 commits November 23, 2023 15:45
In SFSAtomicWriter::complete(), when put RGW_ATTR_OBJECT_RETENTION
attribute in attrs, directly encode RGWObjectRetention object in the
map.

Signed-off-by: Giuseppe Baccini <[email protected]>
When an object is uploaded with multipart, for object-lock enabled buckets,
the default rentention mode must be set in the object's attributes
(when a retention mode is not explicitely set by the user for the object).
Therefore, RGW_ATTR_OBJECT_RETENTION must be set in the attrs of each part
being uploaded in the SFSMultipartUploadV2::complete() function.

Fixes: https://github.com/aquarist-labs/s3gw/issues/761
Signed-off-by: Giuseppe Baccini <[email protected]>
@giubacc giubacc force-pushed the fix-default-retention-mode-multipart-upload-v2 branch from 10f1362 to 6bc54b5 Compare November 23, 2023 14:48
@jecluis jecluis merged commit b0643fb into aquarist-labs:s3gw Dec 4, 2023
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/rgw-sfs RGW & SFS related kind/bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] rgw/sfs: default retention mode not applied to objects on multipart_upload_v2::complete
3 participants