Skip to content

Optimize oplog size by stripping locations of large objects#2715

Open
delthas wants to merge 5 commits intodevelopment/9.3from
improvement/BB-491/strip-oplog-location
Open

Optimize oplog size by stripping locations of large objects#2715
delthas wants to merge 5 commits intodevelopment/9.3from
improvement/BB-491/strip-oplog-location

Conversation

@delthas
Copy link
Contributor

@delthas delthas commented Feb 12, 2026

Issue: BB-491

Issue: BB-491
Signed-off-by: Thomas Flament <thomas.flament@scality.com>
@bert-e
Copy link
Contributor

bert-e commented Feb 12, 2026

Hello delthas,

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 TBA
/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.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.29%. Comparing base (20b5374) to head (d4ad94a).
⚠️ Report is 22 commits behind head on development/9.3.

Files with missing lines Patch % Lines
extensions/replication/tasks/ReplicateObject.js 0.00% 16 Missing ⚠️
extensions/oplogPopulator/modules/Connector.js 0.00% 9 Missing ⚠️
...ensions/oplogPopulator/pipeline/PipelineFactory.js 0.00% 8 Missing ⚠️
...pulator/pipeline/MultipleBucketsPipelineFactory.js 0.00% 4 Missing ⚠️
extensions/oplogPopulator/OplogPopulator.js 0.00% 3 Missing ⚠️
extensions/oplogPopulator/OplogPopulatorTask.js 0.00% 3 Missing ⚠️
...oplogPopulator/pipeline/WildcardPipelineFactory.js 0.00% 3 Missing ⚠️
...nsions/oplogPopulator/modules/ConnectorsManager.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 Δ
...ns/oplogPopulator/OplogPopulatorConfigValidator.js 100.00% <ø> (ø)
...nsions/oplogPopulator/modules/ConnectorsManager.js 92.59% <0.00%> (-1.49%) ⬇️
extensions/oplogPopulator/OplogPopulator.js 86.82% <0.00%> (-2.33%) ⬇️
extensions/oplogPopulator/OplogPopulatorTask.js 0.00% <0.00%> (ø)
...oplogPopulator/pipeline/WildcardPipelineFactory.js 70.00% <0.00%> (-30.00%) ⬇️
...pulator/pipeline/MultipleBucketsPipelineFactory.js 63.63% <0.00%> (-36.37%) ⬇️
...ensions/oplogPopulator/pipeline/PipelineFactory.js 65.21% <0.00%> (-34.79%) ⬇️
extensions/oplogPopulator/modules/Connector.js 77.66% <0.00%> (-7.44%) ⬇️
extensions/replication/tasks/ReplicateObject.js 87.36% <0.00%> (-3.98%) ⬇️

... and 1 file with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.22% <ø> (ø)
Core Library 81.12% <ø> (+0.01%) ⬆️
Ingestion 71.14% <ø> (ø)
Lifecycle 78.62% <ø> (ø)
Oplog Populator 80.33% <0.00%> (-4.74%) ⬇️
Replication 59.08% <0.00%> (-0.48%) ⬇️
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.3    #2715      +/-   ##
===================================================
- Coverage            74.57%   74.29%   -0.29%     
===================================================
  Files                  200      200              
  Lines                13562    13592      +30     
===================================================
- Hits                 10114    10098      -16     
- Misses                3438     3484      +46     
  Partials                10       10              
Flag Coverage Δ
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 10.81% <0.00%> (+0.50%) ⬆️

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.

@scality scality deleted a comment from bert-e Feb 12, 2026
@bert-e
Copy link
Contributor

bert-e commented Feb 12, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas
Copy link
Contributor Author

delthas commented Feb 12, 2026

Manually tested with varying values and single-part, empty, and multi-part objects, works.

Also manually tested changing the configuration on the fly, properly applies, and properly resumes the pipeline with the token.

This saves space on the Kafka side while preventing a refetch
on most (small) objects.

Issue: BB-491
Signed-off-by: Thomas Flament <thomas.flament@scality.com>
Issue: BB-491
Signed-off-by: Thomas Flament <thomas.flament@scality.com>
@delthas delthas force-pushed the improvement/BB-491/strip-oplog-location branch from d48fd8a to e34f3dc Compare February 24, 2026 12:04
@delthas delthas force-pushed the improvement/BB-491/strip-oplog-location branch from 89e94a0 to d4ad94a Compare February 24, 2026 18:35
@delthas delthas force-pushed the improvement/BB-491/strip-oplog-location branch from d4ad94a to db7640b Compare February 25, 2026 09:08
@delthas
Copy link
Contributor Author

delthas commented Feb 25, 2026

Tested on a live cluster, working.

'fullDocument.value.location': {
$cond: {
if: { $gte: [
'$fullDocument.value.content-length',
Copy link
Contributor

Choose a reason for hiding this comment

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

how does $gte behave if there is no $fullDocument.value.content-length field : does it go into the then or else case? (i.e. how does it compare undefined vs a number)

may be good to add a test for this specific case (not sure it really happen, but maybe in some corner case like pushing empty objet...), to ensure we are not adding any risk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In MongoDB's BSON comparison order, null/missing values are less than any number (MinKey < Null < Numbers < ...). So when content-length is missing, $gte: [null, threshold] evaluates to false, and the else branch is taken, preserving the location field as-is.

This is the correct behavior — if we don't know the object size, we keep the location.

Working on a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually we do not have functional tests using Mongo + Kafka + Kafka Connect here? So not really testable as is here. Maybe in Zenko?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking more of a "unit" test, i.e. just trying to use the pipeline returned by getPipeline with mongo : create object in mongo, then make a query with the pipeline and check the result (and repeat with different "kinds" of objects)

Copy link
Contributor

Choose a reason for hiding this comment

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

if later you can add functional tests in zenko i think it would be nice

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