Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Optimize message payload traffic for ShadowReplicator #23236

Merged

Conversation

RobertIndie
Copy link
Member

@RobertIndie RobertIndie commented Aug 30, 2024

Motivation

Currently, the ShadowReplicator syncs all message payloads from the source topic to the shadow topic (ShadowManagedLedger). This significantly increases traffic between brokers. However, the ShadowManagedLedger only requires the position information from these messages. It can retrieve the payload directly from the Bookkeeper. Therefore, the ShadowReplicator does not need to sync the message payloads between brokers.

Modifications

  • Prevent ShadowReplicator from syncing message payloads

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: RobertIndie#16

@RobertIndie RobertIndie self-assigned this Aug 30, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 30, 2024
## Motivation
Currently, the ShadowReplicator will sync all the message payload from the source topic to the shadow topic(ShadowManagedLedger). This increases traffic between brokers significantly. Actually, the ShadowManagedLedger only need the position information from this replicated message. It can get the payload from the Bookkeeper directly. The ShadowReplicator don't need to sync the message payload between the broker

## Modification

- Prevent ShadowReplicator from syncing message payloads
@RobertIndie RobertIndie marked this pull request as ready for review September 2, 2024 01:26
@RobertIndie RobertIndie added this to the 4.0.0 milestone Sep 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.57%. Comparing base (bbc6224) to head (0bafb35).
Report is 561 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23236      +/-   ##
============================================
+ Coverage     73.57%   74.57%   +0.99%     
- Complexity    32624    33778    +1154     
============================================
  Files          1877     1926      +49     
  Lines        139502   145011    +5509     
  Branches      15299    15859     +560     
============================================
+ Hits         102638   108136    +5498     
+ Misses        28908    28608     -300     
- Partials       7956     8267     +311     
Flag Coverage Δ
inttests 27.66% <0.00%> (+3.07%) ⬆️
systests 24.65% <0.00%> (+0.33%) ⬆️
unittests 73.94% <100.00%> (+1.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...org/apache/bookkeeper/mledger/impl/OpAddEntry.java 73.84% <100.00%> (+1.02%) ⬆️
...ar/broker/service/persistent/ShadowReplicator.java 60.46% <100.00%> (+1.92%) ⬆️
...ava/org/apache/pulsar/client/impl/MessageImpl.java 76.11% <100.00%> (-8.27%) ⬇️

... and 558 files with indirect coverage changes

@RobertIndie RobertIndie marked this pull request as draft September 2, 2024 07:48
@RobertIndie RobertIndie marked this pull request as ready for review September 3, 2024 15:19
@BewareMyPower BewareMyPower added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages release/3.3.2 labels Sep 5, 2024
@BewareMyPower BewareMyPower merged commit de68e25 into apache:master Sep 5, 2024
57 checks passed
@lhotari
Copy link
Member

lhotari commented Sep 5, 2024

It looks like this would require #22972 changes for applying this cleanly to branch-3.3 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.3 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.3.2 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants