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

@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.

@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 96.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.00%. Comparing base (dfee42b) to head (e9b9e42).

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

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/gc/tasks/GarbageCollectorTask.js 88.00% <100.00%> (+0.09%) ⬆️
.../lifecycle/tasks/LifecycleColdStatusArchiveTask.js 92.00% <100.00%> (+0.16%) ⬆️
...le/tasks/LifecycleResetTransitionInProgressTask.js 82.60% <100.00%> (+2.60%) ⬆️
extensions/lifecycle/tasks/LifecycleTask.js 91.76% <100.00%> (+0.04%) ⬆️
extensions/lifecycle/LifecycleQueuePopulator.js 81.66% <96.07%> (+2.43%) ⬆️

... and 4 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.25% <ø> (ø)
Core Library 81.95% <ø> (-0.45%) ⬇️
Ingestion 71.37% <ø> (ø)
Lifecycle 80.68% <96.66%> (+0.22%) ⬆️
Oplog Populator 85.80% <ø> (ø)
Replication 62.17% <ø> (ø)
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.6    #2830      +/-   ##
===================================================
- Coverage            76.13%   76.00%   -0.13%     
===================================================
  Files                  204      204              
  Lines                14056    14097      +41     
===================================================
+ Hits                 10701    10715      +14     
- Misses                3345     3372      +27     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.42% <0.00%> (-0.03%) ⬇️
api:routes 9.19% <0.00%> (-0.03%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 9.60% <1.66%> (-1.81%) ⬇️
ingestion 12.55% <0.00%> (-0.04%) ⬇️
lib 9.18% <0.00%> (-0.05%) ⬇️
lifecycle 19.55% <3.33%> (-0.07%) ⬇️
notification 1.00% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️
replication 19.20% <0.00%> (+0.02%) ⬆️
unit 56.07% <96.66%> (+0.42%) ⬆️

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
@francoisferrand
francoisferrand force-pushed the improvement/BB-786-direct-to-cold branch from c10b011 to 02191ba Compare August 28, 2026 11:14
@bert-e

bert-e commented Aug 28, 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
francoisferrand requested review from a team, DarkIsDude and benzekrimaha August 28, 2026 11:19
@francoisferrand francoisferrand removed their assignment Aug 28, 2026
@francoisferrand
francoisferrand force-pushed the improvement/BB-786-direct-to-cold branch from 02191ba to 85b3f9f Compare August 28, 2026 15:59
Comment thread extensions/gc/tasks/GarbageCollectorTask.js Outdated
Comment thread extensions/lifecycle/tasks/LifecycleResetTransitionInProgressTask.js Outdated
Comment thread extensions/gc/tasks/GarbageCollectorTask.js Outdated
Comment thread extensions/lifecycle/tasks/LifecycleResetTransitionInProgressTask.js Outdated
Comment thread extensions/lifecycle/tasks/LifecycleTask.js
Comment thread extensions/gc/tasks/GarbageCollectorTask.js Outdated
Comment thread extensions/lifecycle/LifecycleQueuePopulator.js Outdated
Comment thread extensions/lifecycle/LifecycleQueuePopulator.js
Comment thread extensions/lifecycle/LifecycleQueuePopulator.js Outdated
Comment thread extensions/lifecycle/LifecycleQueuePopulator.js Outdated
@bert-e

bert-e commented Aug 31, 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

The following reviewers are expecting changes from the author, or must review again:

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
The queue populator parsed each oplog entry several times: once in filter()
to look at the bucket, then again in every handler it may call. Each handler
also re-checked the originOp it cares about, so the list of interesting
operations was spread over the whole file.

Decode the entry once in filter() and switch on the originOp there, passing
the parsed value down. Handlers now only decide whether the object itself
qualifies, which is what the new transition handler needs anyway.

Issue: BB-786
The restore and transition handlers each repeated the same two guards on
the oplog entry: mpu shadow bucket keys, and the master entry of a
versioned object, which duplicates the version entry processed on its
own. Group them in a single predicate, so both handlers agree on what
counts as an object entry worth acting upon.

In the restore handler this guard sat below the branch adjusting the
restore expiry of an already-restored object: master and version entry
both reached it, and the adjust message was published twice for every
versioned object. Checking upfront leaves a single publication.

The delete handler keeps its own guards: it takes the raw entry before
parsing, and skips null versions and delete markers as well.

Issue: BB-786
@francoisferrand
francoisferrand force-pushed the improvement/BB-786-direct-to-cold branch from 85b3f9f to e9b9e42 Compare September 2, 2026 14:52
Comment thread extensions/gc/tasks/GarbageCollectorTask.js
Comment thread extensions/lifecycle/tasks/LifecycleTask.js
);

const topic = `${coldStorageArchiveTopicPrefix}${coldLocation}`;
const key = `${entry.bucket}/${entry.key}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the message matches sendDataMoverAction, the key doesn't: there it's ${bucket}/${key} with the plain key, here it's uri-encoded with the \0<versionId> still on it. Meaning we have the same object, different partition depending on which producer sent it. this is consistent with _handleRestoreOp below, so maybe fine... but does sorbet key on it? if not I'd recommend dropping the "strictly the same" from the description and from the test name.

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