CLDSRV-1009: keep object metadata when restoring from cold storage - #6315
Conversation
The cold backend writes the restored object back with a PutObject (or CompleteMultipartUpload) carrying its own headers, so the object ended up with the SDK default content-type and lost cache-control, content-disposition, content-encoding and expires. Object lock retention was dropped too, or silently recomputed from the bucket default rule. Take all of these from the archived metadata instead of the restore request. Issue: CLDSRV-1009
The restored version must carry the object lock info of the archived object. The object lock headers of the restore request and the bucket default retention could otherwise override it, or add a retention the archived object did not have. Issue: CLDSRV-1009
Hello francoisferrand,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 1 file with indirect coverage changes @@ Coverage Diff @@
## development/9.4 #6315 +/- ##
===================================================
+ Coverage 86.49% 86.51% +0.02%
===================================================
Files 212 212
Lines 14567 14585 +18
===================================================
+ Hits 12599 12618 +19
+ Misses 1968 1967 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
The ACL of a restored object must be the one of the archived object: ACL headers sent by the cold backend on the restore PutObject would otherwise override it. Issue: CLDSRV-1009
The cold storage restore functional tests for PutObject and CompleteMPU with x-scal-s3-version-id still asserted the old behaviour, where content-type and content-encoding were taken from the restore request. These are system metadata of the archived object and are now preserved on restore, so the tests must expect the archived values. Issue: CLDSRV-1009 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
722d238 to
b54d5fb
Compare
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
1 similar comment
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
Issue: CLDSRV-1009
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
This pull request did not target the following hotfix branch(es) so they
Please check the status of the associated issue CLDSRV-1009. Goodbye francoisferrand. The following options are set: approve |
When the cold backend restores an object, it writes it back with a PutObject (or CompleteMPU) on the archived version. That request carries the backend's own headers, not the user's, so the restored version was losing system metadata: content-type was reset to
binary/octet-stream, and cache-control, content-disposition, content-encoding and expires were dropped.The restore now takes these fields from the archived object, along with retention mode/date.
A second commit makes sure object lock info also comes only from the archived object: the object lock headers of the restore request and the bucket default retention are ignored, so a restore can't change the retention or add one the object didn't have.
Issue: CLDSRV-1009