Skip to content

CLDSRV-956: accept RestoreObject during the direct-to-cold archive window - #6291

Merged
bert-e merged 2 commits into
development/9.5from
improvement/CLDSRV-956
Sep 15, 2026
Merged

bert-e merged 2 commits into
development/9.5from
improvement/CLDSRV-956

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

An object written directly to a cold location (CLDSRV-917) is declared cold as soon as the PUT returns, but its data stays in the hot location until the lifecycle queue populator drives the transition. Nothing lets a client see that window — it looks like a regular cold object — so a conforming application may legitimately issue a RestoreObject, which we rejected with InvalidObjectState since the object is not in a cold location yet.

Such a restore is now accepted and recorded in the archive block (restoreRequestedAt, restoreRequestedDays), without any archiveInfo: there is nothing to recall yet, so backbeat initiates it once the archive completes (BB-804). The client gets the usual 202 and ongoing-request="true", indistinguishable from a slow cold backend, and a repeated request updates the pending one rather than failing as already in progress.

Keying on archiveInfo rather than on the presence of the archive block matters in two places: the object stays readable while its data is still hot, and the queue populator uses the same signal to tell a direct-to-cold object from a restored one — so recording a restore does not stop it from being picked up for transition.

Creating such objects remains gated by enableDirectToCold. Restoring one that already exists is not, so turning the flag off does not strand objects behind.

Note on quotas: a deferred restore is charged against hot space like any other, so the object is briefly counted twice during the archive window, until the GC removes the hot copy on archive completion. That is deliberate — the deferred restore is later initiated by the queue populator, which never goes through the quota path, so skipping the charge here would leave the restored copy unaccounted for.

HeadObject needed no change: it already reports the cold storage class, the transition flag and x-amz-restore. Tests now pin that.

The second commit keeps the cold condition in verifyColdObjectAvailable untouched and only adds an early return for objects with no archive info. Collapsing it into a single !restoreCompletedAt test, as the first commit did, also made an archived object with a completed restore but no restore request readable — the wrong direction for data sitting in a cold backend.

Issue: CLDSRV-956

@bert-e

bert-e commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Hello francoisferrand,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/bypass_source_branch_lineage Bypass the cross-branch contamination check
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

An object written directly to a cold location is declared cold as soon as
the PUT returns, but its data stays hot until the queue populator drives
the transition. Nothing lets a client see that window, so it may
legitimately ask for a restore, which was rejected since the object is not
in a cold location yet.

Such a restore is now accepted and simply recorded in the archive
metadata, without any archive info: there is nothing to recall yet, so
backbeat initiates it once the archive completes. The client gets the
usual 202 and ongoing-request="true", indistinguishable from a slow cold
backend, and a repeated request updates the pending one instead of failing
as already in progress.

The object is still physically hot in that state, so reading it keeps
working: the availability check now keys on the archive info rather than
on the mere presence of an archive block, which is also how the queue
populator tells a direct-to-cold object from a restored one. Restoring it
does not reserve any hot space either, as it is already accounted for.

Creating such objects remains gated by enableDirectToCold, but restoring
one which already exists is not, so that turning the flag off does not
strand objects behind.

Issue: CLDSRV-956
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.56%. Comparing base (ca73322) to head (e552011).
⚠️ Report is 2 commits behind head on development/9.5.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/object/coldStorage.js 100.00% <100.00%> (+2.17%) ⬆️
@@                 Coverage Diff                 @@
##           development/9.5    #6291      +/-   ##
===================================================
+ Coverage            86.54%   86.56%   +0.01%     
===================================================
  Files                  213      213              
  Lines                14615    14621       +6     
===================================================
+ Hits                 12649    12657       +8     
+ Misses                1966     1964       -2     
Flag Coverage Δ
checksums-disabled-tests 35.37% <20.00%> (-0.01%) ⬇️
file-ft-tests 70.07% <35.00%> (-0.01%) ⬇️
file-ft-tests-null-compat 70.50% <45.00%> (-0.06%) ⬇️
kmip-ft-tests 28.14% <15.00%> (-0.01%) ⬇️
mongo-v0-ft-tests 71.11% <45.00%> (-0.08%) ⬇️
mongo-v1-ft-tests 71.11% <45.00%> (-0.01%) ⬇️
multiple-backend 36.12% <20.00%> (-0.01%) ⬇️
s3c-ft-tests-v0 65.04% <35.00%> (-0.01%) ⬇️
s3c-ft-tests-v0-null-compat 65.09% <35.00%> (-0.01%) ⬇️
s3c-ft-tests-v1 65.02% <35.00%> (-0.01%) ⬇️
sur-tests 36.66% <30.00%> (-0.88%) ⬇️
sur-tests-inflights 39.49% <30.00%> (+0.02%) ⬆️
unit 74.31% <100.00%> (+0.02%) ⬆️
utapi-v2-tests 35.35% <20.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The prettier CI check runs on the files touched by a PR, so the ones this
change touches now need to comply.

Issue: CLDSRV-956
@francoisferrand
francoisferrand requested review from a team, benzekrimaha and delthas September 14, 2026 07:03
@scality scality deleted a comment from bert-e Sep 14, 2026
@bert-e

bert-e commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@francoisferrand

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.5

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/8.8.45
  • hotfix/7.7.0
  • hotfix/7.4.6
  • hotfix/7.4.3
  • hotfix/7.10.49
  • hotfix/7.70.11
  • hotfix/9.2.24
  • hotfix/7.10.15
  • hotfix/7.10.27
  • hotfix/7.10.3
  • hotfix/7.4.5
  • hotfix/7.4.4
  • hotfix/7.70.45
  • hotfix/7.10.2
  • hotfix/7.4.8
  • hotfix/7.70.21
  • hotfix/7.4.1
  • hotfix/9.0.32
  • hotfix/6.4.7
  • hotfix/7.4.7
  • hotfix/9.3.13
  • hotfix/7.10.4
  • hotfix/7.6.0
  • hotfix/7.10.30
  • hotfix/7.70.73
  • hotfix/7.9.0
  • hotfix/7.4.10
  • hotfix/7.10.8
  • hotfix/7.70.51
  • hotfix/7.8.0
  • hotfix/7.4.0
  • hotfix/9.0.7
  • hotfix/7.10.0
  • hotfix/7.10.28
  • hotfix/7.4.9
  • hotfix/7.10.1
  • hotfix/7.2.0
  • hotfix/7.4.2
  • hotfix/9.2.36

Please check the status of the associated issue CLDSRV-956.

Goodbye francoisferrand.

The following options are set: approve

@bert-e
bert-e merged commit e552011 into development/9.5 Sep 15, 2026
38 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-956 branch September 15, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants