Skip to content

Never garbage-collect data on an isCRR location - #2828

Merged
bert-e merged 2 commits into
development/9.6from
improvement/BB-813
Sep 11, 2026
Merged

Never garbage-collect data on an isCRR location#2828
bert-e merged 2 commits into
development/9.6from
improvement/BB-813

Conversation

@francoisferrand

@francoisferrand francoisferrand commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Data living on an isCRR location is production data owned by a remote site. We may read it (that is the whole point of localizing a clean room object), but we must never delete it. That is a general rule keyed on the location type, not a clean room conditional and not behind a config flag.

It needs to hold at two independent points, one commit each.

BB-813 - do not trigger the GC. The copy engine reuses the lifecycle transition pipeline: CopyLocationTask copies the data locally, then LifecycleUpdateTransitionTask merges the new location into the metadata and publishes a deleteData action for the old one. Against an isCRR source that would wipe the remote production copy, so unlike a transition, the localization merge leaves the from-location alone and publishes nothing. This also gives us replay safety for duplicate copy actions: the second merge supersedes the first and collects its copy, which is only safe because the first never touched the remote source.

BB-818 - guard the GC service. The same rule applied where data actually gets deleted, whatever published the action. The service only has data to delete, and it has no way to delete data living on a remote location. Getting such an action is a bug upstream, hence the warning rather than silence, but there is nothing to do about it here beyond skipping it. No completion metric is emitted for a delete that did not happen.

Both check the location of the data being collected rather than the object storage class, because the two can disagree. If the object changes while the copy is in flight - the queue populator captures its eTag and lastModified, and the merge re-reads metadata later - the copy is discarded and we collect the local data we just wrote. Metadata was never updated at that point, so the storage class still names the isCRR location while the data to collect is local. Keying on the storage class would skip that collection and leak the local copy, which nothing else would ever pick up since metadata still points at the remote data.

Issue: BB-813
Issue: BB-818

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

@bert-e

bert-e commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

The Fix Version/s in issue BB-813 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.6.0

Please check the Fix Version/s of BB-813, or the target
branch of this pull request.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.70%. Comparing base (8123def) to head (f9f4df4).
⚠️ Report is 2 commits behind head on development/9.6.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/gc/tasks/GarbageCollectorTask.js 88.54% <100.00%> (+0.45%) ⬆️
...s/lifecycle/tasks/LifecycleUpdateTransitionTask.js 94.87% <100.00%> (+0.22%) ⬆️

... and 5 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.25% <ø> (ø)
Core Library 83.03% <ø> (+0.73%) ⬆️
Ingestion 74.49% <ø> (ø)
Lifecycle 81.07% <100.00%> (+0.05%) ⬆️
Oplog Populator 85.80% <ø> (ø)
Replication 62.85% <ø> (+0.03%) ⬆️
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.6    #2828      +/-   ##
===================================================
+ Coverage            76.37%   76.70%   +0.32%     
===================================================
  Files                  205      205              
  Lines                14215    14225      +10     
===================================================
+ Hits                 10857    10911      +54     
+ Misses                3348     3304      -44     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.32% <0.00%> (-0.01%) ⬇️
api:routes 9.09% <0.00%> (-0.01%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 11.36% <0.00%> (+1.46%) ⬆️
ingestion 12.92% <0.00%> (-0.01%) ⬇️
lib 9.09% <0.00%> (-0.01%) ⬇️
lifecycle 19.44% <0.00%> (-0.02%) ⬇️
notification 0.99% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️
replication 19.05% <0.00%> (+0.07%) ⬆️
unit 57.36% <100.00%> (+0.03%) ⬆️

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 marked this pull request as ready for review August 24, 2026 08:31
@francoisferrand francoisferrand self-assigned this Aug 24, 2026
@francoisferrand
francoisferrand marked this pull request as draft August 24, 2026 12:39
@francoisferrand
francoisferrand marked this pull request as ready for review August 24, 2026 12:40
@francoisferrand
francoisferrand marked this pull request as draft August 26, 2026 07:52
@delthas

delthas commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

lib tests: all failures are in tests/functional/lib/BackbeatConsumer.js ("ledger drain on rebalance", then a cascade of Local: Erroneous state poisoning the following suites). PR Skip non-localized entries in replication and lifecycle #2827 and PR Trigger localization of clean room objects #2826 fail with the exact same assertion ("expected committed offset to advance from N to N+1 after deferred onEntryCommittable") and neither touches BackbeatConsumer either, so it looks like a flaky/broken test on development/9.6.

Now fixed, rebase and enjoy :)

delthas added a commit that referenced this pull request Aug 27, 2026
Data on an `isCRR` location belongs to a remote site: it may be read, but
never deleted, and a version whose data still lives there has not been
localized yet. Several places need to ask that question.

Lifted verbatim from BB-813 (#2828), which introduces the same helper and
carries its unit test and the location fixture. Kept byte-identical so that
whichever branch lands second has this commit dropped as already applied,
rather than conflicting.

Issue: BB-811
delthas added a commit that referenced this pull request Aug 31, 2026
Data on an `isCRR` location belongs to a remote site: it may be read, but
never deleted, and a version whose data still lives there has not been
localized yet. Several places need to ask that question.

Lifted verbatim from BB-813 (#2828), which introduces the same helper and
carries its unit test and the location fixture. Kept byte-identical so that
whichever branch lands second has this commit dropped as already applied,
rather than conflicting.

Issue: BB-811
@francoisferrand
francoisferrand changed the base branch from development/9.6 to improvement/BB-816-skip-non-localized-en September 4, 2026 23:00
Comment thread lib/util/locations.js Outdated
@francoisferrand
francoisferrand force-pushed the improvement/BB-813 branch 3 times, most recently from 7e46ca1 to 226a14c Compare September 4, 2026 23:46
@francoisferrand
francoisferrand marked this pull request as ready for review September 4, 2026 23:57
@francoisferrand
francoisferrand requested review from a team, DarkIsDude and maeldonn September 4, 2026 23:57
Comment thread extensions/gc/tasks/GarbageCollectorTask.js Outdated
Comment thread extensions/lifecycle/tasks/LifecycleUpdateTransitionTask.js Outdated
@francoisferrand francoisferrand removed their assignment Sep 7, 2026
delthas added a commit that referenced this pull request Sep 10, 2026
Data on an `isCRR` location belongs to a remote site: it may be read, but
never deleted, and a version whose data still lives there has not been
localized yet. Several places need to ask that question.

Lifted verbatim from BB-813 (#2828), which introduces the same helper and
carries its unit test and the location fixture. Kept byte-identical so that
whichever branch lands second has this commit dropped as already applied,
rather than conflicting.

Issue: BB-811
In a clean room, objects exist locally in metadata but their data still
lives on the production (isCRR) location. Localizing such an object
reuses the lifecycle transition pipeline, which normally garbage-collects
the from-location once the copy is merged into metadata: against an isCRR
source that would delete production data on the remote site.

Data on an isCRR location is remote production data and must never be
garbage-collected. Make it a general rule keyed on the location type
rather than a clean-room special case, so it also holds for a plain
lifecycle transition out of such a location. The rollback paths, which
collect the freshly written local copy, are unaffected.

This also underpins the replay-safety of duplicate copy actions: the
first merge must not collect the remote source.

Issue: BB-813
Not triggering the collection from the copy engine only covers one
publisher. The GC service is the single point where data actually gets
deleted, so guard there too: any deleteData action targeting an isCRR
location is dropped, whoever published it.

The service only has data to delete, and it has no way to delete data
living on a remote location. Getting such an action is a bug upstream,
hence the warning, but there is nothing that can be done about it
beyond skipping it.

Issue: BB-818
@francoisferrand
francoisferrand force-pushed the improvement/BB-816-skip-non-localized-en branch from bbd96de to 8123def Compare September 11, 2026 14:10
@francoisferrand

Copy link
Copy Markdown
Contributor Author

/approve

Base automatically changed from improvement/BB-816-skip-non-localized-en to development/9.6 September 11, 2026 14:29
@bert-e

bert-e commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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

  • ✔️ development/9.6

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.6
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4
  • development/9.5

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

  • hotfix/9.0.7
  • hotfix/8.2.12
  • hotfix/7.4.8
  • hotfix/7.4.4
  • hotfix/7.10.12
  • hotfix/7.10.3
  • hotfix/7.9.0
  • hotfix/7.10.1
  • hotfix/7.10.8
  • hotfix/7.7.0
  • hotfix/7.70.12
  • hotfix/7.70.15
  • hotfix/9.0.4
  • hotfix/7.4.5
  • hotfix/7.4.6
  • hotfix/7.4.1
  • hotfix/7.10.0
  • hotfix/7.10.2
  • hotfix/7.4.2
  • hotfix/7.10.4
  • hotfix/7.4.0
  • hotfix/7.4.7
  • hotfix/7.70.1
  • hotfix/7.4.3
  • hotfix/7.4.10
  • hotfix/7.6.0
  • hotfix/7.8.0
  • hotfix/7.2.0
  • hotfix/7.4.9
  • hotfix/7.10.17

Please check the status of the associated issue BB-813.

Goodbye francoisferrand.

The following options are set: approve

@bert-e
bert-e merged commit f9f4df4 into development/9.6 Sep 11, 2026
24 checks passed
@bert-e
bert-e deleted the improvement/BB-813 branch September 11, 2026 14:31
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.

5 participants