Skip to content

Reclaim local data when a localized version is deleted - #2831

Draft
francoisferrand wants to merge 1 commit into
improvement/BB-813from
improvement/BB-815-deletedata
Draft

Reclaim local data when a localized version is deleted#2831
francoisferrand wants to merge 1 commit into
improvement/BB-813from
improvement/BB-815-deletedata

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

Stacked on #2828 (BB-813/BB-818) - review that one first.

In a clean room the bucket location constraint is the isCRR source location, so once an object has been localized its metadata looks exactly like a transitioned object: dataStoreName and location[0] point at the local location instead of the bucket's location. The mongo processor took that as "transitioned to another location" and skipped the delete entirely, so the version stayed in mongo forever and the local copy of the data was never reclaimed.

The processor now recognizes that case: when the bucket location is an isCRR location, any location part that is not on an isCRR location means the object was localized. Those parts are the ones we own, so the delete goes through and a deleteData action is published for them right after the metadata is removed (that ordering means a failure leaks data rather than losing it). Versions that were never localized still have all their parts on the isCRR location, so nothing is published and the existing behaviour is untouched.

Note there is no config flag for this: outside of a clean room there simply are no isCRR locations, so the new branch is unreachable.

Issue: BB-815

In a clean room the bucket location constraint is the isCRR source
location, so once an object has been localized its metadata looks
exactly like a transitioned object: the mongo processor was bailing out
with "transitioned to another location", never deleting the metadata and
leaving the local copy of the data behind forever.

Detect that case and, after the metadata delete, publish a deleteData
action for the local parts only. Versions which were never localized
still point at the isCRR location and are left alone, as before.

Issue: BB-815
@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-815 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-815, or the target
branch of this pull request.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.27273% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.61%. Comparing base (929145d) to head (50c63e9).

Files with missing lines Patch % Lines
extensions/mongoProcessor/MongoQueueProcessor.js 80.76% 5 Missing ⚠️
extensions/mongoProcessor/mongoProcessorTask.js 0.00% 1 Missing ⚠️
lib/util/locations.js 91.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/gc/tasks/GarbageCollectorTask.js 88.63% <100.00%> (+0.73%) ⬆️
...s/lifecycle/tasks/LifecycleUpdateTransitionTask.js 94.33% <100.00%> (+0.33%) ⬆️
extensions/mongoProcessor/mongoProcessorTask.js 0.00% <0.00%> (ø)
lib/util/locations.js 91.66% <91.66%> (ø)
extensions/mongoProcessor/MongoQueueProcessor.js 67.85% <80.76%> (+1.04%) ⬆️

... and 4 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.27% <ø> (ø)
Core Library 81.48% <91.66%> (-0.48%) ⬇️
Ingestion 70.19% <77.77%> (+0.10%) ⬆️
Lifecycle 80.55% <100.00%> (+0.08%) ⬆️
Oplog Populator 85.83% <ø> (ø)
Replication 62.04% <ø> (+0.03%) ⬆️
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.6    #2831      +/-   ##
===================================================
- Coverage            75.77%   75.61%   -0.16%     
===================================================
  Files                  200      201       +1     
  Lines                13922    13972      +50     
===================================================
+ Hits                 10549    10565      +16     
- Misses                3363     3397      +34     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.07% <0.00%> (-0.04%) ⬇️
api:routes 8.84% <0.00%> (-0.04%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 10.10% <0.00%> (-0.93%) ⬇️
ingestion 12.36% <29.09%> (+0.10%) ⬆️
lifecycle 19.22% <0.00%> (-0.10%) ⬇️
notification 1.01% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️
replication 18.78% <0.00%> (-0.08%) ⬇️
unit 55.17% <81.81%> (+0.28%) ⬆️

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 changed the base branch from development/9.6 to improvement/BB-813 August 24, 2026 11:44
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