Skip to content

Keep only the targeted backend in the replica metadata - #2845

Open
maeldonn wants to merge 2 commits into
development/9.5from
bugfix/BB-875/backend-leak
Open

maeldonn wants to merge 2 commits into
development/9.5from
bugfix/BB-875/backend-leak

Conversation

@maeldonn

Copy link
Copy Markdown
Contributor

toReplicaEntry cloned the source entry and only updated the targeted backend, so the destination metadata inherited the statuses of the source's other destinations, frozen at queue time and never refreshed. Keep the targeted backend alone, copying it since clone() shares replicationInfo with the source.

Issue: BB-875

toReplicaEntry cloned the source entry and only updated the targeted
backend, so the destination metadata inherited the statuses of the
source's other destinations, frozen at queue time and never refreshed.
Keep the targeted backend alone, copying it since clone() shares
replicationInfo with the source.

Issue: BB-875
@maeldonn
maeldonn requested review from a team, SylvainSenechal and delthas September 11, 2026 15:37
@bert-e

bert-e commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Hello maeldonn,

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.

@bert-e

bert-e commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

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

  • None

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

  • 9.5.3

  • 9.6.0

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

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.48%. Comparing base (56a3c42) to head (d20c1f2).

Files with missing lines Patch % Lines
lib/models/ObjectQueueEntry.js 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/models/ObjectQueueEntry.js 88.23% <0.00%> (-2.13%) ⬇️

... and 5 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.27% <ø> (ø)
Core Library 81.17% <0.00%> (-0.67%) ⬇️
Ingestion 70.45% <ø> (+0.35%) ⬆️
Lifecycle 80.46% <ø> (ø)
Oplog Populator 85.83% <ø> (ø)
Replication 62.01% <ø> (ø)
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.5    #2845      +/-   ##
===================================================
- Coverage            75.72%   75.48%   -0.25%     
===================================================
  Files                  200      200              
  Lines                13926    13928       +2     
===================================================
- Hits                 10545    10513      -32     
- Misses                3371     3405      +34     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.10% <0.00%> (-0.01%) ⬇️
api:routes 8.86% <0.00%> (-0.01%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 9.18% <0.00%> (-1.85%) ⬇️
ingestion 12.29% <0.00%> (+0.02%) ⬆️
lib 8.78% <0.00%> (-0.02%) ⬇️
notification 1.02% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️

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.

toReplicaEntry(backend) {
const newEntry = this.clone();

// clone() shares replicationInfo with the source: detach before mutating.

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.

should this be fixed in clone() instead? Or are there places where we rely on that shallow cloning behavior?

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.

Needs more investigation but AI is hinting at directly changing Arsenal


// clone() shares replicationInfo with the source: detach before mutating.
newEntry.setReplicationInfo(this.getReplicationInfo());
const matched = newEntry._findBackend(backend);

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.

why should we send this: our "local" replication status makes no sense on the remote site, should not even be sent ?

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.

I'm guessing it's important since the pr and jira ticket were probably created after an issue was found 🤔 I think the current implementation is messing up with collectResponseHeader in cloudserver, right @maeldonn ?

@@ -232,9 +232,15 @@ class ObjectQueueEntry extends ObjectMD {

toReplicaEntry(backend) {

@SylvainSenechal SylvainSenechal Sep 16, 2026

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.

I think in the end the required change is not that complicated, but it took me a fair bit of discussion with ai to understand whats happening and why we are doing this change.

The comment "// clone() shares replicationInfo with the source: detach before mutating." didn't really help me understand what was happening

I think the comment can be more straightforward, if I understood correctly, the issue is :
A source replication site can now be used to replicate to multiple destination. When creating the destination entry, we only care about writing into that destinationEntry the data about where it was replicated, and not the other site, thus the findBackend and matched new thing.

So if I understood correctly, I think it should be more made more clear by the comment .

As always, I think it's not helping that the function has variables named replicationBackendS(its a location?)/site, there is also another setReplicationBackends without an s

Anyways, I think this probably just needs one more comment around findBackend to explain why and thats it

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