Skip to content

BB-786: trigger cold transition from oplog - #2830

Open
francoisferrand wants to merge 3 commits into
development/9.6from
improvement/BB-786-direct-to-cold
Open

BB-786: trigger cold transition from oplog#2830
francoisferrand wants to merge 3 commits into
development/9.6from
improvement/BB-786-direct-to-cold

Conversation

@francoisferrand

@francoisferrand francoisferrand commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Support "direct-to-cold" transitions: an object uploaded with a cold storage class must end up archived in that cold location, without waiting for a lifecycle rule.

Cloudserver (out of scope here) stores the data in the hot location on such a PUT, and records the requested cold class in x-amz-storage-class together with the transition-in-progress flag, while keeping the ordinary create origin op so that bucket notifications still fire.

The lifecycle queue populator now detects these objects from the MongoDB oplog and publishes the cold archive request, reusing the exact message shape of ReplicationAPI.sendDataMoverAction: the whole downstream pipeline (Sorbet -> cold status topic -> LifecycleColdStatusArchiveTask -> GC) is unchanged. The populator is strictly publish-only, and never writes object metadata. The discriminator only accepts origin ops that backbeat itself never writes, so a transition is never re-triggered by its own metadata updates; objects already holding archive.archiveInfo are excluded, while a pending deferred restore is not.

The transition-in-progress flag must be kept when requeuing such an object, since that flag (together with the cold storage class) is precisely what identifies it as pending: clearing it would hide the object from the populator and break the retry loop after a single attempt. Conversely, a bucket lifecycle rule must not transition an object which is already declared as cold.

Finally, the metadata update completing the transition is stamped with a distinct s3:LifecycleTransition:Direct origin op when the object already declared the target cold class, so consumers can tell a direct transition from a lifecycle-driven one.

Issue: BB-786

Support "direct-to-cold" transitions: when an object is uploaded with a
cold storage class, cloudserver stores the data in the hot location and
records the requested cold class in the object metadata, together with
the transition-in-progress flag. The lifecycle queue populator now
detects these objects from the oplog and publishes the cold archive
request, reusing the whole existing transition pipeline.

The transition-in-progress flag must not be cleared while requeuing such
an object, since the flag (and the cold storage class) is what identifies
it as pending a direct transition. Conversely, a bucket lifecycle rule
must not transition an object which is already declared as cold.

The metadata update completing the transition is stamped with a distinct
's3:LifecycleTransition:Direct' origin op, so that consumers can tell a
direct transition from a lifecycle-driven one.

Issue: BB-786
@bert-e

bert-e commented Aug 24, 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
/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.

Use optional chaining and drop the single-use helper, in line with the
rest of the lifecycle code.

Issue: BB-786
@francoisferrand
francoisferrand changed the base branch from development/9.0 to development/9.6 August 25, 2026 12:58
@scality scality deleted a comment from bert-e Aug 25, 2026
@bert-e

bert-e commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Branches have diverged

This pull request's source branch improvement/BB-786-direct-to-cold has diverged from
development/9.6 by more than 50 commits.

To avoid any integration risks, please re-synchronize them using one of the
following solutions:

  • Merge origin/development/9.6 into improvement/BB-786-direct-to-cold
  • Rebase improvement/BB-786-direct-to-cold onto origin/development/9.6

Note: If you choose to rebase, you may have to ask me to rebuild
integration branches using the reset command.

@scality scality deleted a comment from bert-e Aug 25, 2026
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.16%. Comparing base (4821350) to head (c10b011).
⚠️ Report is 327 commits behind head on development/9.6.

Files with missing lines Patch % Lines
extensions/lifecycle/LifecycleQueuePopulator.js 97.61% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/gc/tasks/GarbageCollectorTask.js 87.28% <100.00%> (+0.10%) ⬆️
.../lifecycle/tasks/LifecycleColdStatusArchiveTask.js 90.00% <100.00%> (+0.20%) ⬆️
...le/tasks/LifecycleResetTransitionInProgressTask.js 82.60% <100.00%> (+2.60%) ⬆️
extensions/lifecycle/tasks/LifecycleTask.js 91.56% <100.00%> (+0.04%) ⬆️
extensions/lifecycle/LifecycleQueuePopulator.js 82.32% <97.61%> (+3.10%) ⬆️

... and 4 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.20% <ø> (ø)
Core Library 80.47% <ø> (-0.65%) ⬇️
Ingestion 70.30% <ø> (-0.62%) ⬇️
Lifecycle 78.96% <98.03%> (+0.32%) ⬆️
Oplog Populator 85.06% <ø> (ø)
Replication 58.57% <ø> (ø)
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.6    #2830      +/-   ##
===================================================
- Coverage            74.39%   74.16%   -0.24%     
===================================================
  Files                  201      201              
  Lines                13490    13540      +50     
===================================================
+ Hits                 10036    10042       +6     
- Misses                3444     3488      +44     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.44% <0.00%> (-0.04%) ⬇️
api:routes 9.25% <0.00%> (-0.04%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 8.91% <3.92%> (-1.90%) ⬇️
ingestion 12.52% <0.00%> (-0.11%) ⬇️
lib 7.52% <0.00%> (-0.03%) ⬇️
lifecycle 18.65% <3.92%> (-0.07%) ⬇️
notification 1.03% <0.00%> (-0.01%) ⬇️
replication 18.51% <0.00%> (-0.08%) ⬇️
unit 50.54% <98.03%> (+0.49%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@francoisferrand francoisferrand self-assigned this Aug 25, 2026
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.

2 participants